MCPcopy
hub / github.com/anomalyco/opencode / createPool

Function createPool

packages/session-ui/src/pierre/worker.ts:10–30  ·  view source on GitHub ↗
(lineDiffType: "none" | "word-alt")

Source from the content-addressed store, hash-verified

8}
9
10function createPool(lineDiffType: "none" | "word-alt") {
11 const pool = new WorkerPoolManager(
12 {
13 workerFactory,
14 // poolSize defaults to 8. More workers = more parallelism but
15 // also more memory. Too many can actually slow things down.
16 // NOTE: 2 is probably better for OpenCode, as I think 8 might be
17 // a bit overkill, especially because Safari has a significantly slower
18 // boot up time for workers
19 poolSize: 2,
20 },
21 {
22 theme: "OpenCode",
23 lineDiffType,
24 preferredHighlighter: "shiki-wasm",
25 },
26 )
27
28 void pool.initialize()
29 return pool
30}
31
32let unified: WorkerPoolManager | undefined
33let split: WorkerPoolManager | undefined

Callers 1

getWorkerPoolFunction · 0.85

Calls 1

initializeMethod · 0.80

Tested by

no test coverage detected