HTTP.AbortController (http_fetch v0.1.0)
Provides request cancellation functionality similar to the browser's AbortController.
Summary
Functions
Aborts the associated HTTP request. Sends a stop signal to :httpc if a request is active and not already aborted.
Checks if the controller has been aborted.
Returns a specification to start this module under a supervisor.
Creates a new AbortController instance. Returns the PID of the agent, which acts as the controller reference.
Sets the :httpc
request_id for the given controller.
This links the controller to an active request.
Starts a new AbortController agent.
Returns {:ok, pid}
of the agent.
Types
Functions
@spec abort(pid()) :: :ok
Aborts the associated HTTP request. Sends a stop signal to :httpc if a request is active and not already aborted.
Checks if the controller has been aborted.
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec new() :: pid()
Creates a new AbortController instance. Returns the PID of the agent, which acts as the controller reference.
Sets the :httpc
request_id for the given controller.
This links the controller to an active request.
Starts a new AbortController agent.
Returns {:ok, pid}
of the agent.