Move to custom stream storage

This commit is contained in:
Carl Lerche
2017-08-02 12:55:41 -07:00
parent 19e562f9e0
commit 341e15769e
6 changed files with 90 additions and 13 deletions

View File

@@ -1,16 +1,16 @@
mod recv;
mod send;
mod store;
use self::recv::Recv;
use self::send::Send;
use self::store::{Store, Entry};
use {frame, Peer, StreamId, ConnectionError};
use proto::*;
use error::Reason::*;
use error::User::*;
use ordermap::{OrderMap, Entry};
// TODO: All the VecDeques should become linked lists using the state::Stream
// values.
#[derive(Debug)]
@@ -19,11 +19,9 @@ pub struct Streams<P> {
inner: Inner<P>,
/// Streams
streams: StreamMap,
streams: Store,
}
type StreamMap = OrderMap<StreamId, state::Stream>;
/// Fields needed to manage state related to managing the set of streams. This
/// is mostly split out to make ownership happy.
///
@@ -59,7 +57,7 @@ impl<P: Peer> Streams<P> {
recv: Recv::new(&config),
send: Send::new(&config),
},
streams: OrderMap::default(),
streams: Store::new(),
}
}