Struct QueuedMonitor

Source
pub struct QueuedMonitor<Source, Mode, Verdict = Incremental, VerdictTime = RelativeFloat>
where Source: EventFactory, Mode: ExecutionMode, Verdict: VerdictRepresentation, VerdictTime: OutputTimeRepresentation + 'static,
{ /* private fields */ }
Expand description

The QueuedMonitor is a threaded version of the Api allowing deadlines to be evaluated immediately.

The QueuedMonitor accepts new events and computes streams. It can compute streams based on new events through accept_event once the start function was invoked. Timed streams are evaluated automatically at their deadline. The resulting verdicts of events and deadlines are returned through a Receiver which can be obtained through output_queue. Note that the start function has to be invoked before any event can be evaluated. Finally, a calling end will block until all events have been evaluated.

The generic argument Source implements the EventFactory trait describing the input source of the API. The generic argument SourceTime implements the TimeRepresentation trait defining the input time format. The generic argument Verdict implements the VerdictRepresentation trait describing the output format of the API that is by default Incremental. The generic argument VerdictTime implements the TimeRepresentation trait defining the output time format. It defaults to RelativeFloat

Implementations§

Source§

impl<Source, Mode, Verdict, VerdictTime> QueuedMonitor<Source, Mode, Verdict, VerdictTime>
where Source: EventFactory + 'static, Mode: ExecutionMode, Verdict: VerdictRepresentation, VerdictTime: OutputTimeRepresentation,

Source

pub fn start(&mut self) -> Result<(), QueueError>

Starts the evaluation process. This method has to be called before any event is accepted.

Source

pub fn output_queue(&self) -> Receiver<QueuedVerdict<Verdict, VerdictTime>>

This method returns the queue through which the verdicts can be received.

Source

pub fn accept_event( &mut self, ev: Source::Record, ts: <Mode::SourceTime as TimeRepresentation>::InnerTime, ) -> Result<(), QueueError>

Schedules a new event for evaluation. The verdict can be received through the Queue return by the QueuedMonitor::output_queue.

Source

pub fn end(self) -> Result<(), QueueError>

Ends the evaluation process and blocks until all events are processed.

Source

pub fn ir(&self) -> &RtLolaMir

Returns the underlying representation of the specification as an RtLolaMir

Source

pub fn name_for_input(&self, id: InputReference) -> &str

Get the name of an input stream based on its InputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn name_for_output(&self, id: OutputReference) -> &str

Get the name of an output stream based on its OutputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn trigger_stream_index(&self, id: usize) -> usize

Get the OutputReference of a trigger based on its index.

Source

pub fn number_of_input_streams(&self) -> usize

Get the number of input streams.

Source

pub fn number_of_output_streams(&self) -> usize

Get the number of output streams (this includes one output stream for each trigger).

Source

pub fn number_of_triggers(&self) -> usize

Get the number of triggers.

Source

pub fn type_of_input(&self, id: InputReference) -> &Type

Get the type of an input stream based on its InputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn type_of_output(&self, id: OutputReference) -> &Type

Get the type of an output stream based on its OutputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn extend_rate_of_output(&self, id: OutputReference) -> Option<Duration>

Get the extend rate of an output stream based on its OutputReference.

The reference is valid for the lifetime of the monitor.

Source§

impl<Source, SourceTime, Verdict, VerdictTime> QueuedMonitor<Source, OfflineMode<SourceTime>, Verdict, VerdictTime>
where Source: EventFactory + 'static, SourceTime: TimeRepresentation, Verdict: VerdictRepresentation, VerdictTime: OutputTimeRepresentation,

Source

pub fn bounded_setup( config: Config<OfflineMode<SourceTime>, VerdictTime>, setup_data: Source::CreationData, input_queue_bound: QueueLength, output_queue_bound: QueueLength, ) -> QueuedMonitor<Source, OfflineMode<SourceTime>, Verdict, VerdictTime>

setup the api, while providing bounds for the queues.

Source

pub fn setup( config: Config<OfflineMode<SourceTime>, VerdictTime>, setup_data: Source::CreationData, ) -> QueuedMonitor<Source, OfflineMode<SourceTime>, Verdict, VerdictTime>

setup the api with unbounded queues

Source§

impl<Source, Verdict, VerdictTime> QueuedMonitor<Source, OnlineMode, Verdict, VerdictTime>
where Source: EventFactory + 'static, Verdict: VerdictRepresentation, VerdictTime: OutputTimeRepresentation,

Source

pub fn bounded_setup( config: Config<OnlineMode, VerdictTime>, setup_data: Source::CreationData, input_queue_bound: QueueLength, output_queue_bound: QueueLength, ) -> QueuedMonitor<Source, OnlineMode, Verdict, VerdictTime>

setup the api, while providing bounds for the queues.

Source

pub fn setup( config: Config<OnlineMode, VerdictTime>, setup_data: Source::CreationData, ) -> QueuedMonitor<Source, OnlineMode, Verdict, VerdictTime>

setup the api with unbounded queues

Auto Trait Implementations§

§

impl<Source, Mode, Verdict, VerdictTime> Freeze for QueuedMonitor<Source, Mode, Verdict, VerdictTime>

§

impl<Source, Mode, Verdict = Vec<(usize, Vec<Change>)>, VerdictTime = RelativeFloat> !RefUnwindSafe for QueuedMonitor<Source, Mode, Verdict, VerdictTime>

§

impl<Source, Mode, Verdict, VerdictTime> Send for QueuedMonitor<Source, Mode, Verdict, VerdictTime>

§

impl<Source, Mode, Verdict, VerdictTime> Sync for QueuedMonitor<Source, Mode, Verdict, VerdictTime>

§

impl<Source, Mode, Verdict, VerdictTime> Unpin for QueuedMonitor<Source, Mode, Verdict, VerdictTime>
where <VerdictTime as TimeRepresentation>::InnerTime: Unpin, Verdict: Unpin,

§

impl<Source, Mode, Verdict = Vec<(usize, Vec<Change>)>, VerdictTime = RelativeFloat> !UnwindSafe for QueuedMonitor<Source, Mode, Verdict, VerdictTime>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> CondDeserialize for T

Source§

impl<T> CondSerialize for T