MongoDB implementation of Rheo.Backend.
Requires {:mongodb_driver, "~> 1.5"} in your dependencies.
Prefer the Rheo facade for application code. The opaque handle is the Mongo
process name (or pid) started via child_spec/1.
Collections
streams— stream registry and sequence allocatorevents— immutable event loggroups— consumer group registry and materialization cursordeliveries— per(stream, group, event_id)lease / ACK / DLQ state
Supervision example
children = [
{Rheo, name: MyRheo, backend: {Rheo.Backend.Mongo, url: "mongodb://localhost:27017/rheo"}}
]Callback semantics are documented on Rheo.Backend.
Summary
Functions
@spec child_spec(keyword()) :: Supervisor.child_spec()
Child spec for the Mongo connection process (backend handle).
Arguments
opts— keyword options::url— Mongo URL (default:Application.get_env(:rheo, :mongo_url)):name— handle / process name (default:default_handle/0):pool_size— pool size (default5)- plus other options accepted by
Mongo.start_link/1
Examples
iex> spec = Rheo.Backend.Mongo.child_spec(url: "mongodb://localhost:27017/rheo", name: :demo_mongo)
iex> {spec.id, elem(spec.start, 0), Keyword.fetch!(elem(spec.start, 2) |> hd(), :name)}
{{Mongo, :demo_mongo}, Mongo, :demo_mongo}Returns
A supervisor child spec map. Does not raise; missing :mongo_url when :url
is omitted raises ArgumentError via Application.fetch_env!/2 at start time.
@spec default_handle() :: atom()
Default Mongo handle name for the Rheo instance.
Examples
iex> Rheo.Backend.Mongo.default_handle()
Rheo.MongoReturns
A process name atom (default Rheo.Mongo).