Struct glommio::sync::Gate [−][src]
pub struct Gate { /* fields omitted */ }
Facility to achieve graceful shutdown by waiting for the dependent tasks to complete.
Implementations
impl Gate
[src]
impl Gate
[src]pub fn new() -> Self
[src]
Create a new Gate
pub fn enter(&self) -> Result<Pass, GlommioError<()>>
[src]
Get a visitor pass which will be waited to be released on closing
pub fn spawn<T: 'static>(
&self,
future: impl Future<Output = T> + 'static
) -> Result<Task<T>, GlommioError<()>>
[src]
&self,
future: impl Future<Output = T> + 'static
) -> Result<Task<T>, GlommioError<()>>
Spawn a task for which the gate will wait on closing into the current task queue.
pub fn spawn_into<T: 'static>(
&self,
future: impl Future<Output = T> + 'static,
handle: TaskQueueHandle
) -> Result<Task<T>, GlommioError<()>>
[src]
&self,
future: impl Future<Output = T> + 'static,
handle: TaskQueueHandle
) -> Result<Task<T>, GlommioError<()>>
Spawn a task for which the gate will wait on closing
pub async fn close(&self) -> Result<(), GlommioError<()>>
[src]
Close the gate, and wait for all spawned tasks to complete
pub fn is_open(&self) -> bool
[src]
Whether the gate is open or not
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Gate
impl !RefUnwindSafe for Gate
impl !UnwindSafe for Gate
impl !UnwindSafe for Gate