pub struct ActorRegistry { /* private fields */ }Expand description
In-memory projection of registered remote actors.
Reconstructed from WAL events at bootstrap via ActorRegistry::register
and ActorRegistry::deregister calls. Maintains a secondary index of
actors per tenant for O(N_tenant) lookups.
Implementations§
Source§impl ActorRegistry
impl ActorRegistry
Sourcepub fn register(&mut self, registration: ActorRegistration)
pub fn register(&mut self, registration: ActorRegistration)
Registers an actor. If an actor with this ID already exists, it is replaced.
Sourcepub fn deregister(&mut self, actor_id: ActorId)
pub fn deregister(&mut self, actor_id: ActorId)
Marks an actor as deregistered (inactive).
Sourcepub fn is_active(&self, actor_id: ActorId) -> bool
pub fn is_active(&self, actor_id: ActorId) -> bool
Returns true if the actor is registered and active.
Sourcepub fn get(&self, actor_id: ActorId) -> Option<&ActorRegistration>
pub fn get(&self, actor_id: ActorId) -> Option<&ActorRegistration>
Returns the actor registration, if known.
Sourcepub fn identity(&self, actor_id: ActorId) -> Option<&str>
pub fn identity(&self, actor_id: ActorId) -> Option<&str>
Returns the identity string for the actor (used as WAL lease owner).
Sourcepub fn active_actors_for_tenant(&self, tenant_id: TenantId) -> Vec<ActorId>
pub fn active_actors_for_tenant(&self, tenant_id: TenantId) -> Vec<ActorId>
Returns all active actor IDs for the given tenant.
Sourcepub fn all_actor_ids(&self) -> impl Iterator<Item = ActorId> + '_
pub fn all_actor_ids(&self) -> impl Iterator<Item = ActorId> + '_
Returns an iterator over all actor IDs (active and deregistered).
Trait Implementations§
Source§impl Default for ActorRegistry
impl Default for ActorRegistry
Source§fn default() -> ActorRegistry
fn default() -> ActorRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ActorRegistry
impl RefUnwindSafe for ActorRegistry
impl Send for ActorRegistry
impl Sync for ActorRegistry
impl Unpin for ActorRegistry
impl UnsafeUnpin for ActorRegistry
impl UnwindSafe for ActorRegistry
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