View Source Fluvio.Consumer (fluvio v0.2.4)

PartitionConsumer functionalities. This module is backed by a GenServer.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Starts a Fluvio PartitionConsumer GenServer process linked to the current process.

Invokes the given func/1 for each result in the stream continuously.

Gets next record of the stream. If you want to traverse continuously the stream, you can call stream_each/3, or alternatively recursively call this function.

Unfolds the infinite stream lazily.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

start_link(config, gen_opts \\ [], native_mod \\ Fluvio.Native)

View Source
@spec start_link(map(), list(), any()) :: GenServer.on_start()

Starts a Fluvio PartitionConsumer GenServer process linked to the current process.

Link to this function

stream_each(pid, func, timeout_iter \\ 2)

View Source
@spec stream_each(pid(), (... -> any()), integer()) :: :ok

Invokes the given func/1 for each result in the stream continuously.

Link to this function

stream_next(pid, timeout_iter_ms \\ 2000)

View Source
@spec stream_next(pid(), integer()) ::
  {:ok,
   %Fluvio.Record{
     key: term(),
     offset: term(),
     partition: term(),
     timestamp: term(),
     value: term()
   }}
  | {:stop_next, :stop_next}
  | {:error, bitstring()}

Gets next record of the stream. If you want to traverse continuously the stream, you can call stream_each/3, or alternatively recursively call this function.

Link to this function

stream_unfold(pid, timeout_iter_ms \\ 2000)

View Source
@spec stream_unfold(pid(), integer()) :: Stream

Unfolds the infinite stream lazily.

timeout_iter_ms is a low-level iteration timeout in ms to avoid blocking the DirtyIO Rust NIF for too long.