XmtpElixirSdk.BrowserShim.AsyncStream
(xmtp_elixir_sdk v0.1.2)
Copy Markdown
Small async stream primitive for browser-shim boundaries.
The stream keeps producer and consumer coordination in one process so the
browser layer can stay thin. Values are delivered in FIFO order, and done/1
drains pending consumers before closing the stream.
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
@type state() :: %XmtpElixirSdk.BrowserShim.AsyncStream{ done?: boolean(), queue: :queue.queue(term()), waiters: [{pid(), reference()}] }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close(GenServer.server()) :: :ok
@spec done(GenServer.server()) :: :ok
@spec next(GenServer.server(), timeout()) :: {:ok, term()} | {:done, :closed} | {:error, :timeout}
@spec push(GenServer.server(), term()) :: :ok
@spec start_link(GenServer.options()) :: GenServer.on_start()
@spec stream(GenServer.server()) :: Enumerable.t()