1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! `Job` (shared, driver-agnostic) plus `dispatch()`'s runtime driver
//! dispatch - mirrors `larust_cache::store`'s own `match config
//! .cache_driver.as_str() { ... }` shape, itself modeled on
//! `larust_mail::send::deliver`'s `mail_driver` precedent.
use AppError;
use DeserializeOwned;
use Serialize;
use Future;
/// A unit of deferred work. Implemented once per job type, the same
/// "app implements this once per thing" shape as `Policy<U>`/`Mailable`.
/// Serializes `job` to JSON and enqueues it - durable the moment this
/// returns `Ok`, independent of whether any `xr queue:work` process is
/// currently running to pick it up.
pub async