pub struct MultiNodeSpec { /* private fields */ }Expand description
Multi-node test specification.
Implementations§
Source§impl MultiNodeSpec
impl MultiNodeSpec
pub fn new(name: impl Into<String>, node_count: usize) -> Self
pub fn name(&self) -> &str
pub fn node_count(&self) -> usize
Sourcepub fn node_address(&self, i: usize) -> String
pub fn node_address(&self, i: usize) -> String
Synthesize a per-node identity. Real cross-process tests can derive a TCP address from this string.
Sourcepub async fn boot(&self) -> Result<Vec<ActorSystem>, MultiNodeError>
pub async fn boot(&self) -> Result<Vec<ActorSystem>, MultiNodeError>
Boot node_count distinct in-process ActorSystems. Each
gets a name "<spec>-N". The reference config is used
because per-node config knobs come into play in Phase 6.
Sourcepub async fn barrier(
&self,
label: &str,
timeout: Duration,
) -> Result<(), MultiNodeError>
pub async fn barrier( &self, label: &str, timeout: Duration, ) -> Result<(), MultiNodeError>
Each node calls barrier(label, timeout) with the same label;
the future resolves once all node_count callers have arrived
or timeout elapses (whichever is first).
Backed by tokio::sync::Barrier per label; this avoids the
Notify::notify_waiters race where late waiters miss an
already-fired notification.
Sourcepub async fn shutdown(&self, nodes: Vec<ActorSystem>)
pub async fn shutdown(&self, nodes: Vec<ActorSystem>)
Convenience: terminate every node booted by Self::boot.
Auto Trait Implementations§
impl Freeze for MultiNodeSpec
impl RefUnwindSafe for MultiNodeSpec
impl Send for MultiNodeSpec
impl Sync for MultiNodeSpec
impl Unpin for MultiNodeSpec
impl UnsafeUnpin for MultiNodeSpec
impl UnwindSafe for MultiNodeSpec
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