pub struct ClusterDirectory { /* private fields */ }Available on crate feature
cluster only.Expand description
In-memory cluster directory (control plane): which nodes serve which
streams. Shared (Arc) by every node’s relay in the process.
By default entries live until an explicit withdraw.
Opting into a TTL with with_ttl gives lease parity
with the network DirectoryServer:
an announce is valid only for the TTL, so a peer that
stops a stream without withdraw (e.g. it crashed) is dropped on its own,
and locate then steers to a live replica instead of a dead node. Re-
announce within the TTL to keep a lease (the engine’s PublishEnded event
makes a tiny auto-withdraw adapter easy, too).
Implementations§
Source§impl ClusterDirectory
impl ClusterDirectory
Sourcepub fn with_ttl(ttl: Duration) -> Self
pub fn with_ttl(ttl: Duration) -> Self
A directory whose announces carry a ttl lease (network-relay parity);
an entry not re-announced within ttl is reaped on the next access.
Trait Implementations§
Source§impl Debug for ClusterDirectory
impl Debug for ClusterDirectory
Source§impl Default for ClusterDirectory
impl Default for ClusterDirectory
Source§fn default() -> ClusterDirectory
fn default() -> ClusterDirectory
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ClusterDirectory
impl RefUnwindSafe for ClusterDirectory
impl Send for ClusterDirectory
impl Sync for ClusterDirectory
impl Unpin for ClusterDirectory
impl UnsafeUnpin for ClusterDirectory
impl UnwindSafe for ClusterDirectory
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