Checking for a job state

@ajakblackgoat, sorry for the delay. As for now, you can query jobs only by their ID. Later I’m planning to add the filtering feature, but it will require table or index scan and is not affordable for applications (except for monitoring). If you want to track your jobs, integrate background job ids with your domain model and query jobs based on their Ids.

But it is better to add another attribute to your entities, such as IsCompleted, or PercentsCompleted, because:

  • succeeded or deleted background jobs expire after some time (one day by default), and it is hard to determine whether it was succeeded or deleted;
  • it is hard to predict the state consequence of a single job. The simplest path is: EnqueuedProcessingSucceeded, but it can be EnqueuedProcessingSucceededDeleted by adminEnqueued by other adminProcessingFailedDeleted – state workflow can be very complex, do not rely on them.