KubeMQ.EventStoreStreamHandle (kubemq v1.0.1)

Copy Markdown View Source

Handle for streaming persistent events with awaitable confirmation.

Unlike KubeMQ.EventStreamHandle, each send/2 call waits for server confirmation and returns {:ok, %EventStoreResult{}}.

Usage

{:ok, handle} = KubeMQ.Client.send_event_store_stream(client)
{:ok, result} = KubeMQ.EventStoreStreamHandle.send(handle, event_store)
:ok = KubeMQ.EventStoreStreamHandle.close(handle)

Summary

Functions

Returns a specification to start this module under a supervisor.

Close the event store stream handle, terminating the underlying gRPC stream.

Send a persistent event through the streaming handle and await confirmation.

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 event store stream handle, terminating the underlying gRPC stream.

send(handle, event)

@spec send(t(), KubeMQ.EventStore.t()) ::
  {:ok, KubeMQ.EventStoreResult.t()} | {:error, KubeMQ.Error.t()}

Send a persistent event through the streaming handle and await confirmation.

Unlike KubeMQ.EventStreamHandle.send/2, this call waits for the server to confirm persistence and returns {:ok, %KubeMQ.EventStoreResult{}}.

start_link(opts)

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