pub struct OutputAgent { /* private fields */ }
Expand description
Actor-like, dedicated worker thread that handles writing to an output stream. Accepts tasks as messages, which are executed by the agent.
Note that the OutputAgent type is not meant to be Sync, it is meant to be synchronized externally, or more typically, used by one controlling thread only.
Implementations§
Source§impl OutputAgent
impl OutputAgent
pub fn start_with_provider<OUT, OUT_P>( msg_writer_provider: OUT_P, ) -> OutputAgent
pub fn start<AGENT_RUNNER>(agent_runner: AGENT_RUNNER) -> OutputAgentwhere
AGENT_RUNNER: AgentRunnable + Send + 'static,
pub fn is_shutdown(&self) -> bool
pub fn try_submit_task( &self, task: OutputAgentTask, ) -> Result<(), SendError<OutputAgentMessage>>
pub fn submit_task(&self, task: OutputAgentTask)
pub fn request_shutdown(&mut self)
pub fn shutdown_and_soft_join(&mut self) -> Result<()>
pub fn shutdown_and_join(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OutputAgent
impl !RefUnwindSafe for OutputAgent
impl Send for OutputAgent
impl Sync for OutputAgent
impl Unpin for OutputAgent
impl !UnwindSafe for OutputAgent
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