pub async fn enqueue_on<'e, E: PgExecutor<'e>>(
executor: E,
job: &NewJob,
) -> Result<Uuid>Expand description
Add job on executor, usually the caller’s transaction, and return its id.
The job then commits or rolls back with the transaction. A job with a
NewJob::unique key that is already queued or running adds nothing, and the id
is that job’s.
§Errors
Fails on a database error, with Error::NotATenant for a tenant that is not a
tenant id, and with Error::NotACode for a key that is not a code, before
anything is written.