Struct holochain::core::queue_consumer::TriggerSender
source · [−]pub struct TriggerSender { /* private fields */ }
Expand description
The means of nudging a queue consumer to tell it to look for more work
Implementations
sourceimpl TriggerSender
impl TriggerSender
sourcepub fn new() -> (TriggerSender, TriggerReceiver)
pub fn new() -> (TriggerSender, TriggerReceiver)
Create a new channel for waking a consumer
sourcepub fn new_with_loop(
range: Range<Duration>,
reset_on_trigger: bool
) -> (TriggerSender, TriggerReceiver)
pub fn new_with_loop(
range: Range<Duration>,
reset_on_trigger: bool
) -> (TriggerSender, TriggerReceiver)
Create a new channel trigger that will also trigger
on a loop.
The duration takes a range so that the loop can
be set to back off from the lowest to the highest duration.
If you do not want a back off, set the duration range
to the same value like: Duration::from_millis(10)..Duration::from_millis(10)
If reset_on_trigger is true, the back off will be reset whenever a
trigger is received.
sourcepub fn trigger(&self)
pub fn trigger(&self)
Lazily nudge the consumer task, ignoring the case where the consumer already has a pending trigger signal
sourcepub fn reset_back_off(&self)
pub fn reset_back_off(&self)
Reset the back off to the lowest duration. If no back off is set this is a no-op.
sourcepub fn pause_loop(&self)
pub fn pause_loop(&self)
Pause the trigger loop if there is one.
sourcepub fn resume_loop_now(&self)
pub fn resume_loop_now(&self)
Resume the trigger loop now if there is one.
This will resume the loop even if it is currently listening (the workflow is not running). The downside to this call is that if the workflow is running it will immediately run a second time.
This call is a no-op if the loop is not paused.
sourcepub fn resume_loop(&self)
pub fn resume_loop(&self)
Resume the trigger loop if there is one.
This will cause the loop to to resume after the
next trigger (or if the workflow is currently in progress).
It will not cause the loop to resume immediately.
If the loop is currently listening (the workflow is not running)
then nothing will happen until the next trigger.
See resume_loop_now
for a version that will resume immediately.
This call is a no-op if the loop is not paused.
Trait Implementations
sourceimpl Clone for TriggerSender
impl Clone for TriggerSender
sourcefn clone(&self) -> TriggerSender
fn clone(&self) -> TriggerSender
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for TriggerSender
impl Send for TriggerSender
impl Sync for TriggerSender
impl Unpin for TriggerSender
impl !UnwindSafe for TriggerSender
Blanket Implementations
impl<T> Any for T where
T: Any + ?Sized,
impl<T> Any for T where
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745 Read more
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more