Skip to main content

SourceHandle

Struct SourceHandle 

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

Scripts and observes a MemorySource. Cloneable; all clones address the same source.

Implementations§

Source§

impl SourceHandle

Source

pub fn assign_lanes(&self, lanes: &[(LaneId, PartitionId)])

Queue an assignment event: the source’s next poll_events returns SourceEvent::LanesAssigned with one MemoryLane per pair.

§Panics

Panics on duplicate lane ids (within the call or against currently active lanes) or on a partition that is already served by an active lane — both would be runtime bugs in a real deployment.

Source

pub fn revoke_lanes(&self, lanes: &[LaneId]) -> DrainBarrierProbe

Queue a revocation event for lanes and return a probe over its DrainBarrier. The barrier expects one arrival per revoked lane (a pipeline thread owning several of them arrives once per lane it stops).

§Panics

Panics if any lane is not currently active.

Source

pub fn push( &self, partition: PartitionId, key: Option<&[u8]>, payload: &[u8], ) -> i64

Queue one payload on partition with timestamp_ms equal to the assigned offset. Returns that offset. Pushing to a partition that has no active lane yet is allowed — payloads wait.

Source

pub fn push_at( &self, partition: PartitionId, key: Option<&[u8]>, payload: &[u8], timestamp_ms: Option<i64>, ) -> i64

push with an explicit event timestamp.

Source

pub fn push_many<I, P>(&self, partition: PartitionId, payloads: I) -> Vec<i64>
where I: IntoIterator<Item = P>, P: AsRef<[u8]>,

Queue several keyless payloads; returns their offsets.

Source

pub fn committed(&self) -> Vec<(PartitionId, i64)>

Every watermark ever passed to Source::commit, in call order (flattened).

Source

pub fn last_committed(&self, partition: PartitionId) -> Option<i64>

The most recent committed position for partition, if any.

Source

pub fn wait_committed( &self, partition: PartitionId, offset: i64, timeout: Duration, ) -> bool

Block until partition’s most recent committed offset reaches at least offset, or timeout elapses; returns whether the target was met.

The blocking counterpart to last_committed: waking on each Source::commit rather than polling. Pass the one-past-last watermark (e.g. last_offset + 1) to wait for every pushed record to be durably committed.

Source

pub fn paused_lanes(&self) -> Vec<LaneId>

Lanes currently paused via Source::pause, ascending.

Source

pub fn flush_commits_calls(&self) -> usize

How many times Source::flush_commits was called.

Source

pub fn is_open(&self) -> bool

Whether Source::open has been called.

Trait Implementations§

Source§

impl Clone for SourceHandle

Source§

fn clone(&self) -> SourceHandle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SourceHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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