Skip to main content

IntervalPipe

Struct IntervalPipe 

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

Periodic producer Pipe. Fires every period, dispatches a Request built by request_factory to inner.

The pipe is content-agnostic: the request factory decides whether the body is empty Bytes, Bytes::from_static(b"..."), a Carry typed payload, or stream — anything the spine can hold. The method-byte and path are configurable per the discriminant convention; default to TICK / /tick so a bare IntervalPipe works as a heartbeat source without any extra config.

Implementations§

Source§

impl IntervalPipe

Source

pub fn new( period: Duration, inner: PipeHandle, request_factory: RequestFactory, name: impl Into<String>, ) -> Self

Construct directly. Most callers should use Self::builder.

Source

pub fn builder() -> IntervalPipeBuilder

Fluent builder entry point (workspace principle 4).

Source

pub fn name(&self) -> &str

The source’s label, set via IntervalPipeBuilder::name (default "interval"). Used as the ProducerLifecycle::spawn_from_source task name by convention; carries no other runtime behaviour.

Source

pub fn empty_request_factory() -> RequestFactory

Build the default RequestFactory — emits a Request with method DEFAULT_TICK_METHOD, path DEFAULT_TICK_PATH, no headers, and an empty Bytes body. Useful when the inner Pipe only cares about the timing edge, not the payload.

Trait Implementations§

Source§

impl SendPipe for IntervalPipe

Source§

type In = Signal

Input the pipe consumes.
Source§

type Out = ()

Output the pipe produces.
Source§

type Err = ProximaError

Error the pipe can fail with — Send here so it can cross cores.
Source§

fn call( &self, cancel: Signal, ) -> impl Future<Output = Result<(), ProximaError>> + Send

Apply the pipe. The returned future IS Send.

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P> SendDynPipe<<P as SendPipe>::In, <P as SendPipe>::Out> for P
where P: SendPipe, <P as SendPipe>::In: Send, ProximaError: From<<P as SendPipe>::Err>,

Source§

fn call_dyn( &self, input: <P as SendPipe>::In, ) -> Pin<Box<dyn Future<Output = Result<<P as SendPipe>::Out, ProximaError>> + Send + '_>>

Erased dispatch — boxes the inner pipe’s Send future and converts its error into ProximaError.
Source§

impl<Implementor> SourcePipe for Implementor
where Implementor: SendPipe<In = Signal, Out = (), Err = ProximaError>,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more