Skip to content

Commit a7e9255

Browse files
committed
graph, store: Remove unused facilities for filtering StoreEventStreams
1 parent 34984d5 commit a7e9255

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

graph/src/components/store/mod.rs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use strum_macros::Display;
1818
pub use traits::*;
1919
pub use write::Batch;
2020

21-
use futures01::{Async, Stream};
21+
use futures01::Stream;
2222
use serde::{Deserialize, Serialize};
2323
use std::collections::btree_map::Entry;
2424
use std::collections::{BTreeMap, BTreeSet, HashSet};
@@ -633,37 +633,8 @@ impl PartialEq for StoreEvent {
633633
}
634634
}
635635

636-
/// A `StoreEventStream` produces the `StoreEvents`. Various filters can be applied
637-
/// to it to reduce which and how many events are delivered by the stream.
638-
pub struct StoreEventStream<S> {
639-
source: S,
640-
}
641-
642636
/// A boxed `StoreEventStream`
643-
pub type StoreEventStreamBox =
644-
StoreEventStream<Box<dyn Stream<Item = Arc<StoreEvent>, Error = ()> + Send>>;
645-
646-
impl<S> Stream for StoreEventStream<S>
647-
where
648-
S: Stream<Item = Arc<StoreEvent>, Error = ()> + Send,
649-
{
650-
type Item = Arc<StoreEvent>;
651-
type Error = ();
652-
653-
fn poll(&mut self) -> Result<Async<Option<Self::Item>>, Self::Error> {
654-
self.source.poll()
655-
}
656-
}
657-
658-
impl<S> StoreEventStream<S>
659-
where
660-
S: Stream<Item = Arc<StoreEvent>, Error = ()> + Send + 'static,
661-
{
662-
// Create a new `StoreEventStream` from another such stream
663-
pub fn new(source: S) -> Self {
664-
StoreEventStream { source }
665-
}
666-
}
637+
pub type StoreEventStreamBox = Box<dyn Stream<Item = Arc<StoreEvent>, Error = ()> + Send>;
667638

668639
/// An entity operation that can be transacted into the store.
669640
#[derive(Clone, Debug, PartialEq)]

graph/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ pub mod prelude {
131131
EntityCollection, EntityFilter, EntityLink, EntityOperation, EntityOrder,
132132
EntityOrderByChild, EntityOrderByChildInfo, EntityQuery, EntityRange, EntityWindow,
133133
EthereumCallCache, ParentLink, PartialBlockPtr, PoolWaitStats, QueryStore,
134-
QueryStoreManager, StoreError, StoreEvent, StoreEventStream, StoreEventStreamBox,
135-
SubgraphStore, UnfailOutcome, WindowAttribute, BLOCK_NUMBER_MAX,
134+
QueryStoreManager, StoreError, StoreEvent, StoreEventStreamBox, SubgraphStore,
135+
UnfailOutcome, WindowAttribute, BLOCK_NUMBER_MAX,
136136
};
137137
pub use crate::components::subgraph::{
138138
BlockState, HostMetrics, InstanceDSTemplateInfo, RuntimeHost, RuntimeHostBuilder,

store/postgres/src/store_events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,6 @@ impl SubscriptionManagerTrait for SubscriptionManager {
221221
self.subscriptions.write().unwrap().insert(id, sender);
222222

223223
// Return the subscription ID and entity change stream
224-
StoreEventStream::new(Box::new(ReceiverStream::new(receiver).map(Ok).compat()))
224+
Box::new(ReceiverStream::new(receiver).map(Ok).compat())
225225
}
226226
}

0 commit comments

Comments
 (0)