mirror of
https://github.com/actix/actix-web.git
synced 2024-11-03 15:39:50 +00:00
add handle method to contexts
This commit is contained in:
parent
f3cce6a04c
commit
456fd1364a
2 changed files with 14 additions and 0 deletions
|
@ -167,6 +167,13 @@ impl<A, S> HttpContext<A, S> where A: Actor<Context=Self> {
|
|||
}
|
||||
self.stream.as_mut().map(|s| s.push(frame));
|
||||
}
|
||||
|
||||
/// Handle of the running future
|
||||
///
|
||||
/// SpawnHandle is the handle returned by `AsyncContext::spawn()` method.
|
||||
pub fn handle(&self) -> SpawnHandle {
|
||||
self.inner.curr_handle()
|
||||
}
|
||||
}
|
||||
|
||||
impl<A, S> ActorHttpContext for HttpContext<A, S> where A: Actor<Context=Self>, S: 'static {
|
||||
|
|
|
@ -191,6 +191,13 @@ impl<A, S> WebsocketContext<A, S> where A: Actor<Context=Self> {
|
|||
}
|
||||
self.stream.as_mut().map(|s| s.push(frame));
|
||||
}
|
||||
|
||||
/// Handle of the running future
|
||||
///
|
||||
/// SpawnHandle is the handle returned by `AsyncContext::spawn()` method.
|
||||
pub fn handle(&self) -> SpawnHandle {
|
||||
self.inner.curr_handle()
|
||||
}
|
||||
}
|
||||
|
||||
impl<A, S> ActorHttpContext for WebsocketContext<A, S> where A: Actor<Context=Self>, S: 'static {
|
||||
|
|
Loading…
Reference in a new issue