1use apalis_core::task::builder::TaskBuilder;
2
3use crate::context::SqlContext;
4
5pub trait TaskBuilderExt {
7 #[must_use]
9 fn max_attempts(self, attempts: u32) -> Self;
10
11 #[must_use]
13 fn priority(self, priority: i32) -> Self;
14}
15
16impl<Args, Pool, IdType> TaskBuilderExt for TaskBuilder<Args, SqlContext<Pool>, IdType> {
17 fn max_attempts(mut self, attempts: u32) -> Self {
18 self.ctx = self.ctx.with_max_attempts(attempts as i32);
19 self
20 }
21
22 fn priority(mut self, priority: i32) -> Self {
23 self.ctx = self.ctx.with_priority(priority);
24 self
25 }
26}