KubeMQ.QueueUpstreamHandle (kubemq v1.0.1)

Copy Markdown View Source

Handle for sending queue messages via a bidirectional upstream stream.

Obtained via KubeMQ.Client.queue_upstream/1. Each send/2 call writes a batch of messages and awaits the server response.

Usage

{:ok, handle} = KubeMQ.Client.queue_upstream(client)
{:ok, results} = KubeMQ.QueueUpstreamHandle.send(handle, [msg1, msg2])
:ok = KubeMQ.QueueUpstreamHandle.close(handle)

Summary

Functions

Returns a specification to start this module under a supervisor.

Close the queue upstream handle, terminating the underlying gRPC stream.

Send a batch of queue messages through the upstream streaming handle.

Types

t()

@type t() :: GenServer.server()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close(handle)

@spec close(t()) :: :ok

Close the queue upstream handle, terminating the underlying gRPC stream.

send(handle, messages)

@spec send(t(), [KubeMQ.QueueMessage.t()]) ::
  {:ok, [KubeMQ.QueueSendResult.t()]} | {:error, KubeMQ.Error.t()}

Send a batch of queue messages through the upstream streaming handle.

Writes messages to the underlying bidirectional gRPC stream and awaits per-message send results from the server.

start_link(opts)

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