reckon_db_streams_writer (reckon_db v1.6.0)

View Source

Streams writer worker for reckon-db

A gen_server that handles write operations for streams. Writers are temporary processes that terminate after a period of inactivity.

Features: - Partitioned by stream_id for concurrent writes to different streams - Idle timeout to free up resources - Swarm-like registration via pg groups

Summary

Functions

Append events to a stream via a writer worker

Get or create a writer for a stream

Start a writer worker

Functions

append(StoreId, StreamId, ExpectedVersion, Events)

-spec append(atom(), binary(), integer(), [map()]) -> {ok, non_neg_integer()} | {error, term()}.

Append events to a stream via a writer worker

get_writer(StoreId, StreamId)

-spec get_writer(atom(), binary()) -> pid().

Get or create a writer for a stream

start_link(_)

-spec start_link({atom(), binary(), non_neg_integer()}) -> {ok, pid()} | {error, term()}.

Start a writer worker