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

Function getServerHandlersRuntime

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

Source from the content-addressed store, hash-verified

205 null;
206
207const getServerHandlersRuntime = (
208 token: string,
209): ManagedRuntime.ManagedRuntime<ServerHandlersService, never> => {
210 if (serverHandlersRuntime) return serverHandlersRuntime;
211 const layer = Layer.effect(ServerHandlersService)(
212 Effect.acquireRelease(
213 Effect.promise(() => createServerHandlers(token)),
214 (handlers) => Effect.promise(() => closeServerHandlers(handlers)),
215 ),
216 );
217 serverHandlersRuntime = ManagedRuntime.make(layer);
218 return serverHandlersRuntime;
219};
220
221export const getServerHandlers = (token: string): Promise<ServerHandlers> =>
222 getServerHandlersRuntime(token).runPromise(ServerHandlersService.asEffect());

Callers 1

getServerHandlersFunction · 0.85

Calls 2

createServerHandlersFunction · 0.85
closeServerHandlersFunction · 0.85

Tested by

no test coverage detected