Hyperlinkv0.8.0-beta.28

NodeHttpClient

(options?: Https.AgentOptions): Effect.Effect<
  HttpAgent["Service"],
  never,
  Scope.Scope
>

Acquires Node http and https agents with the supplied options and destroys both agents when the enclosing scope is finalized.

HttpAgent
export const makeAgent = (options?: Https.AgentOptions): Effect.Effect<HttpAgent["Service"], never, Scope.Scope> =>
  Effect.zipWith(
    Effect.acquireRelease(
      Effect.sync(() => new Http.Agent(options)),
      (agent) => Effect.sync(() => agent.destroy())
    ),
    Effect.acquireRelease(
      Effect.sync(() => new Https.Agent(options)),
      (agent) => Effect.sync(() => agent.destroy())
    ),
    (http, https) => ({ http, https })
  )
Referenced by 1 symbols