GRPC.Client.Adapters.Gun.StreamResponseProcess (gRPC Client v1.0.1)

Copy Markdown View Source

Owns response state for a single Gun request stream.

Gun can deliver response messages for many concurrent streams over the same connection, so request-specific response handling needs to stay isolated per stream.

This process buffers the messages for one stream, serves them back to the Gun adapter in arrival order, and terminates once the stream has reached a terminal state and all buffered messages have been consumed.

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

state()

@type state() :: %{
  messages: :queue.queue(),
  waiter: {GenServer.from(), reference() | nil} | nil,
  done: boolean()
}

Functions

await(pid, timeout)

@spec await(pid(), timeout()) :: tuple()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link()

@spec start_link() :: GenServer.on_start()