More work

This commit is contained in:
Carl Lerche
2017-08-04 12:12:22 -07:00
parent 74b3852a58
commit fc0a7eb898
9 changed files with 264 additions and 106 deletions

View File

@@ -5,6 +5,12 @@ pub(super) struct Stream<B> {
/// Current state of the stream
pub state: State,
/// Frames pending for this stream to read
pub pending_recv: buffer::Deque<Bytes>,
/// Task tracking receiving frames
pub recv_task: Option<task::Task>,
/// Frames pending for this stream being sent to the socket
pub pending_send: buffer::Deque<B>,
@@ -19,6 +25,8 @@ impl<B> Stream<B> {
pub fn new() -> Stream<B> {
Stream {
state: State::default(),
pending_recv: buffer::Deque::new(),
recv_task: None,
pending_send: buffer::Deque::new(),
next_pending_send: None,
is_pending_send: false,
@@ -32,4 +40,10 @@ impl<B> Stream<B> {
pub fn recv_flow_control(&mut self) -> Option<&mut FlowControl> {
self.state.recv_flow_control()
}
pub fn notify_recv(&mut self) {
if let Some(ref mut task) = self.recv_task {
task.notify();
}
}
}