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>
impl BeatBuilder<LocalSchedulerBackend>
sourcepub fn with_default_scheduler_backend(name: &str, broker_url: &str) -> Self
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,
impl<Sb> BeatBuilder<Sb>where Sb: SchedulerBackend,
sourcepub fn with_custom_scheduler_backend(
name: &str,
broker_url: &str,
scheduler_backend: Sb
) -> Self
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.
sourcepub fn default_queue(self, queue_name: &str) -> Self
pub fn default_queue(self, queue_name: &str) -> Self
Set the name of the default queue to something other than “celery”.
sourcepub fn heartbeat(self, heartbeat: Option<u16>) -> Self
pub fn heartbeat(self, heartbeat: Option<u16>) -> Self
Set the broker heartbeat. The default value depends on the broker implementation.
sourcepub fn task_route(self, pattern: &str, queue: &str) -> Self
pub fn task_route(self, pattern: &str, queue: &str) -> Self
Add a routing rule.
sourcepub fn broker_connection_timeout(self, timeout: u32) -> Self
pub fn broker_connection_timeout(self, timeout: u32) -> Self
Set a timeout in seconds before giving up establishing a connection to a broker.
sourcepub fn broker_connection_retry(self, retry: bool) -> Self
pub fn broker_connection_retry(self, retry: bool) -> Self
Set whether or not to automatically try to re-establish connection to the AMQP broker.
sourcepub fn broker_connection_max_retries(self, max_retries: u32) -> Self
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.
sourcepub fn broker_connection_retry_delay(self, retry_delay: u32) -> Self
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.
sourcepub fn task_content_type(self, content_type: MessageContentType) -> Self
pub fn task_content_type(self, content_type: MessageContentType) -> Self
Set a default content type of the message body serialization.
sourcepub fn max_sleep_duration(self, max_sleep_duration: Duration) -> Self
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.