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

Function getServerHandlersRuntime

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

Source from the content-addressed store, hash-verified

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

Callers 1

getServerHandlersFunction · 0.85

Calls 2

createServerHandlersFunction · 0.85
closeServerHandlersFunction · 0.85

Tested by

no test coverage detected