MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeAgent

Function makeAgent

packages/platform/node/src/NodeHttpClient.ts:673–684  ·  view source on GitHub ↗
(options?: HttpAgentOptions)

Source from the content-addressed store, hash-verified

671 * @since 4.0.0
672 */
673export const makeAgent = (options?: HttpAgentOptions): Effect.Effect<HttpAgent["Service"], never, Scope.Scope> =>
674 Effect.zipWith(
675 Effect.acquireRelease(
676 Effect.sync(() => new http.Agent(options)),
677 (agent) => Effect.sync(() => agent.destroy())
678 ),
679 Effect.acquireRelease(
680 Effect.sync(() => new https.Agent(options)),
681 (agent) => Effect.sync(() => agent.destroy())
682 ),
683 (http, https) => ({ http, https })
684 )
685
686/**
687 * Provides the `HttpAgent` service using scoped Node `http` and `https`

Callers 1

Calls 2

syncMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected