[−][src]Struct celery::CeleryBuilder
Used to create a Celery
app with a custom configuration.
Implementations
impl<Bb> CeleryBuilder<Bb> where
Bb: BrokerBuilder,
[src]
Bb: BrokerBuilder,
pub fn new(name: &str, broker_url: &str) -> Self
[src]
Get a CeleryBuilder
for creating a Celery
app with a custom configuration.
pub fn hostname(self, hostname: &str) -> Self
[src]
Set the node name of the app. Defaults to "{name}@{sys hostname}".
This field should probably be named "nodename" to avoid confusion with the system hostname, but we're trying to be consistent with Python Celery.
pub fn default_queue(self, queue_name: &str) -> Self
[src]
Set the name of the default queue to something other than "celery".
pub fn prefetch_count(self, prefetch_count: u16) -> Self
[src]
Set the prefetch count. The default value depends on the broker implementation, but it's recommended that you always set this to a value that works best for your application.
This may take some tuning, as it depends on a lot of factors, such as whether your tasks are IO bound (higher prefetch count is better) or CPU bound (lower prefetch count is better).
pub fn heartbeat(self, heartbeat: Option<u16>) -> Self
[src]
Set the broker heartbeat. The default value depends on the broker implementation.
pub fn task_timeout(self, task_timeout: u32) -> Self
[src]
Set an app-level timeout for tasks (see
TaskOption::timeout
).
pub fn task_max_retries(self, task_max_retries: u32) -> Self
[src]
Set an app-level maximum number of retries for tasks (see
TaskOption::max_retries
).
pub fn task_min_retry_delay(self, task_min_retry_delay: u32) -> Self
[src]
Set an app-level minimum retry delay for tasks (see
TaskOption::min_retry_delay
).
pub fn task_max_retry_delay(self, task_max_retry_delay: u32) -> Self
[src]
Set an app-level maximum retry delay for tasks (see
TaskOption::max_retry_delay
).
pub fn task_retry_for_unexpected(self, retry_for_unexpected: bool) -> Self
[src]
Set whether by default UnexpectedError
s should be retried for (see
TaskOption::retry_for_unexpected
).
pub fn acks_late(self, acks_late: bool) -> Self
[src]
Set whether by default a task is acknowledged before or after execution (see
TaskOption::acks_late
).
pub fn task_route(self, pattern: &str, queue: &str) -> Self
[src]
Add a routing rule.
pub fn broker_connection_timeout(self, timeout: u32) -> Self
[src]
Set a timeout in seconds before giving up establishing a connection to a broker.
pub fn broker_connection_retry(self, retry: bool) -> Self
[src]
Set whether or not to automatically try to re-establish connection to the AMQP broker.
pub fn broker_connection_max_retries(self, max_retries: u32) -> Self
[src]
Set the maximum number of retries before we give up trying to re-establish connection to the AMQP broker.
pub async fn build(self) -> Result<Celery<Bb::Broker>, CeleryError>
[src]
Construct a Celery
app with the current configuration.
Auto Trait Implementations
impl<Bb> RefUnwindSafe for CeleryBuilder<Bb> where
Bb: RefUnwindSafe,
Bb: RefUnwindSafe,
impl<Bb> Send for CeleryBuilder<Bb> where
Bb: Send,
Bb: Send,
impl<Bb> Sync for CeleryBuilder<Bb> where
Bb: Sync,
Bb: Sync,
impl<Bb> Unpin for CeleryBuilder<Bb> where
Bb: Unpin,
Bb: Unpin,
impl<Bb> UnwindSafe for CeleryBuilder<Bb> where
Bb: UnwindSafe,
Bb: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,