summaryrefslogtreecommitdiffhomepage
path: root/packages/throughput-store/src/extension.ts
blob: 13c4a64e4a8d00d993f08163d8096b6db43bee03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { Extension, HostAPI, Manifest } from "@dispatch/kernel";
import { throughputStoreHandle } from "./service.js";
import { createThroughputStore } from "./store.js";

export const manifest: Manifest = {
  id: "throughput-store",
  name: "Throughput Store",
  version: "0.0.0",
  apiVersion: "^0.1.0",
  trust: "bundled",
  capabilities: { db: true },
  contributes: { services: ["throughput-store/store"] },
  activation: "eager",
};

export const extension: Extension = {
  manifest,
  activate: (host: HostAPI) => {
    const storage = host.storage("throughput-store");
    const store = createThroughputStore({ storage, logger: host.logger });
    host.provideService(throughputStoreHandle, store);
    host.logger.info("throughput-store: registered");
  },
};