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§
source§impl 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, context: &'static &'static str)
pub fn trigger(&self, context: &'static &'static str)
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§
source§impl Clone for TriggerSender
impl Clone for TriggerSender
source§fn clone(&self) -> TriggerSender
fn clone(&self) -> TriggerSender
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto 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 Twhere
T: Any + ?Sized,
impl<T> Any for Twhere
T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
§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> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.