ZenWebsocket.Client.Correlation (ZenWebsocket v0.7.1)

Copy Markdown View Source

JSON-RPC response and timeout correlation for ZenWebsocket.Client.

Summary

Functions

Resolves a JSON-RPC response and records its round-trip latency.

Replies {:error, :timeout} to the caller waiting on request_id.

Applies the pending-request pin checks for Erlang and legacy correlation timeouts.

Functions

handle_response(response, state)

@spec handle_response(map(), map()) :: map()

Resolves a JSON-RPC response and records its round-trip latency.

handle_timeout(state, request_id)

@spec handle_timeout(map(), term()) :: {:noreply, map()}

Replies {:error, :timeout} to the caller waiting on request_id.

handle_timeout_message(state, arg)

@spec handle_timeout_message(map(), term()) :: {:noreply, map()}

Applies the pending-request pin checks for Erlang and legacy correlation timeouts.