View Source cozodb_callback_monitor (cozodb v0.1.0)
A transient worker that is used to listen to certain plum_db events and allow watchers to wait (blocking the caller) for certain conditions. This is used by plum_db_app during the startup process to wait for the following conditions:
* Partition initisalisation – the worker subscribes to plum_db notifications and keeps track of each partition initialisation until they are all initialised (or failed to initilised) and replies to all watchers with a ok
or {error, FailedPartitions}
, where FailedPartitions is a map() which keys are the partition number and the value is the reason for the failure. * Partition hashtree build – the worker subscribes to plum_db notifications and keeps track of each partition hashtree until they are all built (or failed to build) and replies to all watchers with a ok
or {error, FailedHashtrees}
, where FailedHashtrees is a map() which keys are the partition number and the value is the reason for the failure.
Summary
Types
-type state() :: #state{}.
Functions
-spec start_link() -> {ok, pid()} | ignore | {error, term()}.
-spec stop() -> ok.