StreamingProcessor

Struct StreamingProcessor 

Source
pub struct StreamingProcessor { /* private fields */ }
Expand description

Production streaming processor with bounded memory

Implementations§

Source§

impl StreamingProcessor

Source

pub fn new(threshold_bps: u32) -> Result<Self, ProcessingError>

Create new production streaming processor

Source

pub fn with_config( threshold_bps: u32, config: StreamingProcessorConfig, ) -> Result<Self, ProcessingError>

Create with custom configuration

Source

pub fn trade_sender(&mut self) -> Option<Sender<AggTrade>>

Get trade sender for external components

Source

pub fn bar_receiver(&mut self) -> Option<Receiver<RangeBar>>

Get bar receiver for external components

Source

pub async fn start_processing(&mut self) -> Result<(), StreamingError>

Start processing loop (bounded memory, infinite capability)

Source

pub fn metrics(&self) -> &StreamingMetrics

Get current metrics

Source

pub fn get_final_incomplete_bar(&mut self) -> Option<RangeBar>

Extract final incomplete bar when stream ends (for algorithmic consistency)

Source

pub fn check_memory_usage(&self) -> bool

Check memory usage against threshold

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.