MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / getServerHandlersRuntime

Function getServerHandlersRuntime

apps/local/src/main.ts:200–212  ·  view source on GitHub ↗
(
  token: string,
)

Source from the content-addressed store, hash-verified

198 null;
199
200const getServerHandlersRuntime = (
201 token: string,
202): ManagedRuntime.ManagedRuntime<ServerHandlersService, never> => {
203 if (serverHandlersRuntime) return serverHandlersRuntime;
204 const layer = Layer.effect(ServerHandlersService)(
205 Effect.acquireRelease(
206 Effect.promise(() => createServerHandlers(token)),
207 (handlers) => Effect.promise(() => closeServerHandlers(handlers)),
208 ),
209 );
210 serverHandlersRuntime = ManagedRuntime.make(layer);
211 return serverHandlersRuntime;
212};
213
214export const getServerHandlers = (token: string): Promise<ServerHandlers> =>
215 getServerHandlersRuntime(token).runPromise(ServerHandlersService.asEffect());

Callers 1

getServerHandlersFunction · 0.85

Calls 2

createServerHandlersFunction · 0.85
closeServerHandlersFunction · 0.85

Tested by

no test coverage detected