summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2026-04-15 11:23:28 +0800
committerGitHub <[email protected]>2026-04-15 03:23:28 +0000
commit548d9ac7263357b59963318524cbdc697d16565e (patch)
tree818f5ab85b8385eb0203e70609e6cf9c049e17c3
parenta60fd89d1eaf5dd0445d2d6dea9bdc8d48534461 (diff)
downloadopencode-548d9ac7263357b59963318524cbdc697d16565e.tar.gz
opencode-548d9ac7263357b59963318524cbdc697d16565e.zip
core: parallelise bootstrap (#22514)
-rw-r--r--packages/opencode/src/project/bootstrap.ts20
1 files changed, 12 insertions, 8 deletions
diff --git a/packages/opencode/src/project/bootstrap.ts b/packages/opencode/src/project/bootstrap.ts
index 75e3244e1..ed71837de 100644
--- a/packages/opencode/src/project/bootstrap.ts
+++ b/packages/opencode/src/project/bootstrap.ts
@@ -15,14 +15,18 @@ import * as Effect from "effect/Effect"
export const InstanceBootstrap = Effect.gen(function* () {
Log.Default.info("bootstrapping", { directory: Instance.directory })
- yield* Plugin.Service.use((svc) => svc.init())
- yield* ShareNext.Service.use((svc) => svc.init()).pipe(Effect.forkDetach)
- yield* Format.Service.use((svc) => svc.init()).pipe(Effect.forkDetach)
- yield* LSP.Service.use((svc) => svc.init())
- yield* File.Service.use((svc) => svc.init()).pipe(Effect.forkDetach)
- yield* FileWatcher.Service.use((svc) => svc.init()).pipe(Effect.forkDetach)
- yield* Vcs.Service.use((svc) => svc.init()).pipe(Effect.forkDetach)
- yield* Snapshot.Service.use((svc) => svc.init()).pipe(Effect.forkDetach)
+ yield* Effect.all(
+ [
+ Plugin.Service,
+ LSP.Service,
+ ShareNext.Service,
+ Format.Service,
+ File.Service,
+ FileWatcher.Service,
+ Vcs.Service,
+ Snapshot.Service,
+ ].map((s) => Effect.forkDetach(s.use((i) => i.init()))),
+ )
yield* Bus.Service.use((svc) =>
svc.subscribeCallback(Command.Event.Executed, async (payload) => {