pub struct DepartmentRegistry { /* private fields */ }Expand description
Groups actors by department for department-targeted task routing.
The dispatch loop uses this to route tasks that target a specific
department (e.g., "engineering") to only the actors in that group.
First-come-first-serve is enforced via lease atomicity at the WAL level.
Implementations§
Source§impl DepartmentRegistry
impl DepartmentRegistry
Sourcepub fn assign(&mut self, actor_id: ActorId, dept: DepartmentId)
pub fn assign(&mut self, actor_id: ActorId, dept: DepartmentId)
Assigns an actor to a department. If the actor was in another department, they are removed from the previous one.
Sourcepub fn actors_in_department(&self, dept: &DepartmentId) -> &HashSet<ActorId>
pub fn actors_in_department(&self, dept: &DepartmentId) -> &HashSet<ActorId>
Returns the set of actor IDs in the given department.
Sourcepub fn department_of(&self, actor_id: ActorId) -> Option<&DepartmentId>
pub fn department_of(&self, actor_id: ActorId) -> Option<&DepartmentId>
Returns the department of the given actor, if assigned.
Trait Implementations§
Source§impl Default for DepartmentRegistry
impl Default for DepartmentRegistry
Source§fn default() -> DepartmentRegistry
fn default() -> DepartmentRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DepartmentRegistry
impl RefUnwindSafe for DepartmentRegistry
impl Send for DepartmentRegistry
impl Sync for DepartmentRegistry
impl Unpin for DepartmentRegistry
impl UnsafeUnpin for DepartmentRegistry
impl UnwindSafe for DepartmentRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more