Struct celery::beat::BeatBuilder

source ·
pub struct BeatBuilder<Sb>where
    Sb: SchedulerBackend,{ /* private fields */ }
Expand description

Used to create a Beat app with a custom configuration.

Implementations§

source§

impl BeatBuilder<LocalSchedulerBackend>

source

pub fn with_default_scheduler_backend(name: &str, broker_url: &str) -> Self

Get a BeatBuilder for creating a Beat app with a default scheduler backend and a custom configuration.

source§

impl<Sb> BeatBuilder<Sb>where Sb: SchedulerBackend,

source

pub fn with_custom_scheduler_backend( name: &str, broker_url: &str, scheduler_backend: Sb ) -> Self

Get a BeatBuilder for creating a Beat app with a custom scheduler backend and a custom configuration.

source

pub fn default_queue(self, queue_name: &str) -> Self

Set the name of the default queue to something other than “celery”.

source

pub fn heartbeat(self, heartbeat: Option<u16>) -> Self

Set the broker heartbeat. The default value depends on the broker implementation.

source

pub fn task_route(self, pattern: &str, queue: &str) -> Self

Add a routing rule.

source

pub fn broker_connection_timeout(self, timeout: u32) -> Self

Set a timeout in seconds before giving up establishing a connection to a broker.

source

pub fn broker_connection_retry(self, retry: bool) -> Self

Set whether or not to automatically try to re-establish connection to the AMQP broker.

source

pub fn broker_connection_max_retries(self, max_retries: u32) -> Self

Set the maximum number of retries before we give up trying to re-establish connection to the AMQP broker.

source

pub fn broker_connection_retry_delay(self, retry_delay: u32) -> Self

Set the number of seconds to wait before re-trying the connection with the broker.

source

pub fn task_content_type(self, content_type: MessageContentType) -> Self

Set a default content type of the message body serialization.

source

pub fn max_sleep_duration(self, max_sleep_duration: Duration) -> Self

Set a maximum sleep duration, which limits the amount of time that can pass between ticks. This is useful to ensure that the scheduler backend implementation is called regularly.

source

pub async fn build(self) -> Result<Beat<Sb>, BeatError>

Construct a Beat app with the current configuration.

Auto Trait Implementations§

§

impl<Sb> !RefUnwindSafe for BeatBuilder<Sb>

§

impl<Sb> Send for BeatBuilder<Sb>where Sb: Send,

§

impl<Sb> Sync for BeatBuilder<Sb>where Sb: Sync,

§

impl<Sb> Unpin for BeatBuilder<Sb>where Sb: Unpin,

§

impl<Sb> !UnwindSafe for BeatBuilder<Sb>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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