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

Function getServerHandlersRuntime

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

Source from the content-addressed store, hash-verified

138 null;
139
140const getServerHandlersRuntime = (
141 token: string,
142): ManagedRuntime.ManagedRuntime<ServerHandlersService, never> => {
143 if (serverHandlersRuntime) return serverHandlersRuntime;
144 const layer = Layer.effect(ServerHandlersService)(
145 Effect.acquireRelease(
146 Effect.promise(() => createServerHandlers(token)),
147 (handlers) => Effect.promise(() => closeServerHandlers(handlers)),
148 ),
149 );
150 serverHandlersRuntime = ManagedRuntime.make(layer);
151 return serverHandlersRuntime;
152};
153
154export const getServerHandlers = (token: string): Promise<ServerHandlers> =>
155 getServerHandlersRuntime(token).runPromise(ServerHandlersService.asEffect());

Callers 1

getServerHandlersFunction · 0.85

Calls 2

createServerHandlersFunction · 0.85
closeServerHandlersFunction · 0.85

Tested by

no test coverage detected