Struct dataflow::source::Timestamper[][src]

pub struct Timestamper {
    inner: Arc<RwLock<Timestamp>>,
    sender: Sender<Event<Option<Timestamp>, Result<(Row, Timestamp, Diff), SourceError>>>,
    tick_duration: Duration,
    now: NowFn,
}
Expand description

A thread-safe transaction manager that is responsible for assigning timestamps to the transactions submitted to the system. Rows can be inserted individually using the insert and delete methods or as part of a bigger transaction.

When a transaction is started using start_tx the internal clock will be frozen and any subsequent rows will be timestamped with the exact same timestamp. The transaction is committed automatically as soon as the transaction object gets dropped.

Fields

inner: Arc<RwLock<Timestamp>>sender: Sender<Event<Option<Timestamp>, Result<(Row, Timestamp, Diff), SourceError>>>tick_duration: Durationnow: NowFn

Implementations

Start a transaction at a particular point in time. The timestamper will freeze its internal clock while a transaction is active.

Record an insertion of a row

Record a deletion of a row

Records an error. After this method is called the source will permanently be in an errored state

Attempts to monotonically increase the current timestamp and provides a Progress message to timely.

This method will wait for all current transactions to commit before advancing the clock and will cause any new requests for transactions to wait for the tick to complete before starting. This is due to the write-preferring behaviour of the tokio RwLock.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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