Struct data_streaming_service::data_stream::DataStream [−][src]
pub struct DataStream<T> { /* fields omitted */ }Expand description
Each data stream holds the original stream request from the client and tracks the progress of the data stream to satisfy that request (e.g., the data that has already been sent along the stream to the client and the in-flight diem data client requests that have been sent to the network).
Note that it is the responsibility of the data stream to send data notifications along the stream in sequential order (e.g., transactions and proofs must be sent with monotonically increasing versions).
Implementations
pub fn new(
config: DataStreamingServiceConfig,
data_stream_id: DataStreamId,
stream_request: &StreamRequest,
diem_data_client: T,
notification_id_generator: Arc<U64IdGenerator>,
advertised_data: &AdvertisedData
) -> Result<(Self, DataStreamListener), Error>
Returns true iff the first batch of data client requests has been sent
pub fn initialize_data_requests(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
pub fn initialize_data_requests(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
Initializes the data client requests by sending out the first batch
Returns true iff the given notification_id was sent by this stream
pub fn handle_notification_feedback(
&self,
notification_id: &NotificationId,
notification_feedback: &NotificationFeedback
) -> Result<(), Error>
pub fn handle_notification_feedback(
&self,
notification_id: &NotificationId,
notification_feedback: &NotificationFeedback
) -> Result<(), Error>
Notifies the Diem data client of a bad client response
pub fn process_data_responses(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
pub fn process_data_responses(
&mut self,
global_data_summary: GlobalDataSummary
) -> Result<(), Error>
Processes any data client responses that have been received. Note: the responses must be processed in FIFO order.
Verifies that the data required by the stream can be satisfied using the currently advertised data in the network. If not, returns an error.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for DataStream<T>
impl<T> Send for DataStream<T> where
T: Send,
impl<T> !Sync for DataStream<T>
impl<T> Unpin for DataStream<T> where
T: Unpin,
impl<T> !UnwindSafe for DataStream<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self