Struct kay::Networking [−][src]
Represents all networking environment and networking state
of an ActorSystem
Fields
machine_id: MachineID
The machine index of this machine within the network of peers
n_turns: usize
The current network turn this machine is in. Used to keep track if this machine lags behind or runs fast compared to its peers
Methods
impl Networking
[src]
impl Networking
pub fn new(
machine_id: u8,
network: Vec<&'static str>,
batch_message_bytes: usize,
acceptable_turn_distance: usize,
skip_turns_per_turn_head: usize
) -> Networking
[src]
pub fn new(
machine_id: u8,
network: Vec<&'static str>,
batch_message_bytes: usize,
acceptable_turn_distance: usize,
skip_turns_per_turn_head: usize
) -> Networking
Create network environment based on this machines id/index and all peer addresses (including this machine)
pub fn connect(&mut self)
[src]
pub fn connect(&mut self)
Try to connect to peers in the network
pub fn finish_turn(&mut self) -> Option<usize>
[src]
pub fn finish_turn(&mut self) -> Option<usize>
Finish the current networking turn and wait for peers which lag behind based on their turn number. This is the main backpressure mechanism.
pub fn send_and_receive(&mut self, inboxes: &mut [Option<Inbox>])
[src]
pub fn send_and_receive(&mut self, inboxes: &mut [Option<Inbox>])
Send queued outbound messages and take incoming queued messages and forward them to their local target recipient(s)
pub fn enqueue<M: Message>(
&mut self,
message_type_id: ShortTypeId,
packet: Packet<M>
)
[src]
pub fn enqueue<M: Message>(
&mut self,
message_type_id: ShortTypeId,
packet: Packet<M>
)
Enqueue a new (potentially) outbound packet
pub fn debug_all_n_turns(&self) -> HashMap<MachineID, isize>
[src]
pub fn debug_all_n_turns(&self) -> HashMap<MachineID, isize>
Return a debug message containing the current local view of network turn progress of all peers in the network
Auto Trait Implementations
impl Send for Networking
impl Send for Networking
impl Sync for Networking
impl Sync for Networking