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

Function makeAgent

packages/platform/node/src/NodeHttpClient.ts:401–412  ·  view source on GitHub ↗
(options?: Https.AgentOptions)

Source from the content-addressed store, hash-verified

399 * @since 4.0.0
400 */
401export const makeAgent = (options?: Https.AgentOptions): Effect.Effect<HttpAgent["Service"], never, Scope.Scope> =>
402 Effect.zipWith(
403 Effect.acquireRelease(
404 Effect.sync(() => new Http.Agent(options)),
405 (agent) => Effect.sync(() => agent.destroy())
406 ),
407 Effect.acquireRelease(
408 Effect.sync(() => new Https.Agent(options)),
409 (agent) => Effect.sync(() => agent.destroy())
410 ),
411 (http, https) => ({ http, https })
412 )
413
414/**
415 * Provides the `HttpAgent` service using scoped Node `http` and `https`

Callers

nothing calls this directly

Calls 1

syncMethod · 0.45

Tested by

no test coverage detected