Struct psup_impl::Worker [−][src]
Worker process handler.
Implementations
impl<H, F> Worker<H, F> where
H: Fn(UnixStream, String) -> F,
F: Future<Output = Result<()>>,
[src]
H: Fn(UnixStream, String) -> F,
F: Future<Output = Result<()>>,
pub fn new() -> Self
[src]
Create a new worker.
pub fn relaxed(self, flag: bool) -> Self
[src]
Set the relaxed flag.
When a worker is relaxed it will start with or without a supervisor.
The default is false
so workers expect to be run in the context
of a supervisor and it is an error if no worker id is available in
the environment.
When this flag is enabled and the required environment variables do not exist the worker does not attempt to connect to a supervisor.
Use this mode of operation when a worker process can be run standalone or as a worker for a supervisor process.
pub fn client(self, handler: H) -> Self
[src]
Set a client connection handler.
The handler function receives the socket stream and opaque worker identifier and can communicate with the supervisor using the socket stream.
pub async fn run(&self) -> Result<()>
[src]
Start this worker running.
Auto Trait Implementations
impl<H, F> RefUnwindSafe for Worker<H, F> where
H: RefUnwindSafe,
H: RefUnwindSafe,
impl<H, F> Send for Worker<H, F> where
H: Send,
H: Send,
impl<H, F> Sync for Worker<H, F> where
H: Sync,
H: Sync,
impl<H, F> Unpin for Worker<H, F> where
H: Unpin,
H: Unpin,
impl<H, F> UnwindSafe for Worker<H, F> where
H: UnwindSafe,
H: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,