Interface IJobClient
- Namespace
- Millrace
- Assembly
- Millrace.dll
The public enqueue API (ARCHITECTURE.md §5.2). Expressions capture the declared service type, method, and serialized arguments; the target is resolved from the consumer's DI container inside a scope at execution time. Instance methods returning Task only in 0.1; keep job signatures stable and pass ids, not entities.
public interface IJobClient
Methods
- CancelAsync(JobId, CancellationToken)
Cancels a job, returning whether anything was cancelled.
- ContinueWithAsync<T>(JobId, Expression<Func<T, Task>>, EnqueueOptions?, CancellationToken)
Runs after the parent job succeeds; cancelled (transitively) if the parent dies or is cancelled.
- EnqueueAsync<T>(Expression<Func<T, Task>>, EnqueueOptions?, CancellationToken)
Fire-and-forget: claimable immediately.
- EnqueueBatchAsync(JobBatch, CancellationToken)
Enqueues a batch in one round trip and one transaction, returning the effective ids positionally.
- RemoveRecurringAsync(string, CancellationToken)
Removes a cron definition, so it produces no further occurrences.
- RequeueAsync(JobId, CancellationToken)
Runs a finished job again, as a new job carrying a link back to it. Returns the new id, or null if
iddoes not exist.
- RunNowAsync(JobId, CancellationToken)
Runs a job that is waiting out its retry backoff now, returning whether anything changed.
- ScheduleAsync<T>(Expression<Func<T, Task>>, DateTimeOffset, EnqueueOptions?, CancellationToken)
Runs at
at(UTC).
- ScheduleAsync<T>(Expression<Func<T, Task>>, TimeSpan, EnqueueOptions?, CancellationToken)
Runs after
delay.
- TriggerRecurringAsync(string, CancellationToken)
Fires a recurring definition immediately, without disturbing its schedule.
- UpsertRecurringAsync<T>(string, string, Expression<Func<T, Task>>, EnqueueOptions?, CancellationToken)
Creates or updates a cron definition (five-field vixie syntax, UTC). The recurring id is the definition's identity; IdempotencyKey is not supported here in 0.1 and throws.