Forward ActixJob constants to Job

This commit is contained in:
asonix 2021-04-03 16:08:01 -05:00
parent 4954406ba0
commit 7b071278bc
2 changed files with 5 additions and 1 deletions

View file

@ -1,7 +1,7 @@
[package] [package]
name = "background-jobs-core" name = "background-jobs-core"
description = "Core types for implementing an asynchronous jobs processor" description = "Core types for implementing an asynchronous jobs processor"
version = "0.9.1" version = "0.9.2"
license-file = "../LICENSE" license-file = "../LICENSE"
authors = ["asonix <asonix@asonix.dog>"] authors = ["asonix <asonix@asonix.dog>"]
repository = "https://git.asonix.dog/Aardwolf/background-jobs" repository = "https://git.asonix.dog/Aardwolf/background-jobs"

View file

@ -98,6 +98,10 @@ where
type Future = Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>; type Future = Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
const NAME: &'static str = <Self as ActixJob>::NAME; const NAME: &'static str = <Self as ActixJob>::NAME;
const QUEUE: &'static str = <Self as ActixJob>::QUEUE;
const MAX_RETRIES: MaxRetries = <Self as ActixJob>::MAX_RETRIES;
const BACKOFF: Backoff = <Self as ActixJob>::BACKOFF;
const TIMEOUT: i64 = <Self as ActixJob>::TIMEOUT;
fn run(self, state: Self::State) -> Self::Future { fn run(self, state: Self::State) -> Self::Future {
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();