roger v1.2.0 Roger.Partition View Source
Per-node partition registry
Roger implements multi-tenancy by dividing all its work between different “Partitions”. Each partition is identified by a unique ID. Partitions consist of a list of queues, which are defined by its type (an atom) and a max_workers value which sets the concurrency level. The RabbitMQ queue name is constructed of the partition ID + the queue type.
To spread out the work, partitions can be started in the cluster on multiple nodes. The partition’s queue configuration can be different between nodes - i.e. some node might be able to handle more concurrency than others.
Within the cluster, there is one global process
(Roger.Partition.Global
) which manages the partition’s state. In
it, it manages job’s uniqueness, states of paused queues, et cetera.
Link to this section Summary
Functions
Reconfigure the given Roger partition
Start a Roger partition
Stop the given Roger partition
Link to this section Types
queue_def() :: {id :: String.t(), max_workers :: non_neg_integer()}
Link to this section Functions
Reconfigure the given Roger partition
Use this function to adjust the queues for the partition. The queues argument is complete: any queues that are not mentioned, are stopped and messages in them will no longer be processed on this node.
Start a Roger partition
Given a unique ID and a list of queues, starts the partition
supervision structure. When the partition has already been
started, this calls reconfigure/2
instead.
Stop the given Roger partition