pub struct Pollen { /* private fields */ }Expand description
Main Pollen scheduler instance
Implementations§
Source§impl Pollen
impl Pollen
Sourcepub fn builder() -> PollenBuilder
pub fn builder() -> PollenBuilder
Create a new builder
Sourcepub fn is_cluster_mode(&self) -> bool
pub fn is_cluster_mode(&self) -> bool
Check if running in cluster mode
Sourcepub fn define(&self, name: &str) -> TaskBuilder
pub fn define(&self, name: &str) -> TaskBuilder
Define a new task
Sourcepub async fn trigger_with_payload(
&self,
name: &str,
payload: Bytes,
) -> Result<()>
pub async fn trigger_with_payload( &self, name: &str, payload: Bytes, ) -> Result<()>
Trigger a task with payload
Sourcepub fn list_tasks(&self) -> Vec<TaskDef>
pub fn list_tasks(&self) -> Vec<TaskDef>
List all registered tasks
Sourcepub fn cluster_state(&self) -> Option<ClusterState>
pub fn cluster_state(&self) -> Option<ClusterState>
Get cluster state (if in cluster mode)
Sourcepub fn cluster_size(&self) -> usize
pub fn cluster_size(&self) -> usize
Get the number of nodes in the cluster
Auto Trait Implementations§
impl Freeze for Pollen
impl !RefUnwindSafe for Pollen
impl Send for Pollen
impl Sync for Pollen
impl Unpin for Pollen
impl !UnwindSafe for Pollen
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more