pub struct Publisher { /* private fields */ }Expand description
Periodically publishes node state to DHT for peer discovery.
Publishes a record after an initial delay initial_delay, then repeatedly with randomized base_interval + rand(0 to max_jitter) intervals, containing this node’s active neighbor list and message hashes for bubble detection and merging.
Implementations§
Source§impl Publisher
impl Publisher
Sourcepub fn new(
record_publisher: RecordPublisher,
gossip_receiver: GossipReceiver,
cancel_token: CancellationToken,
initial_delay: Duration,
base_interval: Duration,
max_jitter: Duration,
) -> Result<Self>
pub fn new( record_publisher: RecordPublisher, gossip_receiver: GossipReceiver, cancel_token: CancellationToken, initial_delay: Duration, base_interval: Duration, max_jitter: Duration, ) -> Result<Self>
Create a new background publisher.
Spawns a background task that periodically publishes records.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Publisher
impl RefUnwindSafe for Publisher
impl Send for Publisher
impl Sync for Publisher
impl Unpin for Publisher
impl UnsafeUnpin for Publisher
impl UnwindSafe for Publisher
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more