mirror of
https://github.com/actix/actix-extras.git
synced 2024-12-01 02:44:37 +01:00
stop websocket context
This commit is contained in:
parent
35efd017bb
commit
f4873fcdee
@ -27,6 +27,15 @@ pub enum Frame {
|
||||
Drain(oneshot::Sender<()>),
|
||||
}
|
||||
|
||||
impl Frame {
|
||||
pub fn len(&self) -> usize {
|
||||
match *self {
|
||||
Frame::Chunk(Some(ref bin)) => bin.len(),
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Http actor execution context
|
||||
pub struct HttpContext<A, S=()> where A: Actor<Context=HttpContext<A, S>>,
|
||||
{
|
||||
|
@ -58,7 +58,8 @@ impl<A, S> AsyncContext<A> for WebsocketContext<A, S> where A: Actor<Context=Sel
|
||||
#[doc(hidden)]
|
||||
#[inline]
|
||||
fn waiting(&self) -> bool {
|
||||
self.inner.wating()
|
||||
self.inner.wating() || self.inner.start() == ActorState::Stopping ||
|
||||
self.inner.start() == ActorState::Stopped
|
||||
}
|
||||
|
||||
fn cancel_future(&mut self, handle: SpawnHandle) -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user