[][src]Struct celery::Celery

pub struct Celery<B: Broker> {
    pub name: String,
    pub broker: B,
    pub default_queue_name: String,
    pub task_timeout: Option<usize>,
    pub task_max_retries: Option<usize>,
    pub task_min_retry_delay: Option<usize>,
    pub task_max_retry_delay: Option<usize>,
    // some fields omitted
}

A Celery app is used to produce or consume tasks asyncronously.

Fields

name: Stringbroker: Bdefault_queue_name: Stringtask_timeout: Option<usize>task_max_retries: Option<usize>task_min_retry_delay: Option<usize>task_max_retry_delay: Option<usize>

Methods

impl<B> Celery<B> where
    B: Broker + 'static, 
[src]

pub fn builder() -> CeleryBuilder[src]

Get a CeleryBuilder for creating a Celery app with a custom configuration.

pub fn new(name: &str, broker: B) -> Self[src]

Create a new Celery app with the given name.

pub async fn send_task<'_, '_, T: Task>(
    &'_ self,
    task: T,
    queue: &'_ str
) -> Result<(), Error>
[src]

Send a task to a remote worker.

pub fn register_task<T: Task + 'static>(
    &mut self,
    name: &str
) -> Result<(), Error>
[src]

Register a task.

pub async fn execute_task<'_, '_>(
    &'_ self,
    task_name: &'_ str,
    data: Vec<u8>
) -> Result<(), Error>
[src]

pub async fn consume<'_, '_>(&'_ self, queue: &'_ str) -> Result<(), Error>[src]

Consume tasks from the default queue.

Auto Trait Implementations

impl<B> !RefUnwindSafe for Celery<B>

impl<B> !Send for Celery<B>

impl<B> !Sync for Celery<B>

impl<B> Unpin for Celery<B> where
    B: Unpin

impl<B> !UnwindSafe for Celery<B>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,