pub struct WorkerAgent {
pub config: WorkerAgentConfig,
pub broadcast_emitter: Sender<NodeMessageTransporter>,
pub broadcast_receiver: Arc<Mutex<Receiver<NodeMessageTransporter>>>,
/* private fields */
}Fields§
§config: WorkerAgentConfig§broadcast_emitter: Sender<NodeMessageTransporter>§broadcast_receiver: Arc<Mutex<Receiver<NodeMessageTransporter>>>Implementations§
Source§impl WorkerAgent
impl WorkerAgent
pub fn new( config: WorkerAgentConfig, on_message: Arc<dyn MessageHandler>, processor: Arc<dyn Processor>, on_event: Arc<dyn EventHandler>, ) -> Self
pub async fn start(&self, _inputs: Vec<u8>)
pub async fn stop(&self)
pub fn details(&self) -> AgentDetail
Source§impl WorkerAgent
impl WorkerAgent
pub async fn send_direct(&self, to_peer: String, message: Vec<u8>)
pub async fn broadcast(&self, message: Vec<u8>)
pub async fn run_with_config( &self, inputs: Vec<u8>, worker_agent_config: WorkerAgentConfig, runtime: Handle, cancellation_token: CancellationToken, ) -> Vec<JoinHandle<()>>
Auto Trait Implementations§
impl Freeze for WorkerAgent
impl !RefUnwindSafe for WorkerAgent
impl Send for WorkerAgent
impl Sync for WorkerAgent
impl Unpin for WorkerAgent
impl !UnwindSafe for WorkerAgent
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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