module SidekiqAsyncTask
Wrapper around sidekiq to make job scheduling transactional. Provides wrapper methods - perform_with_transaction_in and perform_with_transaction_async over perform_in and perform_async methods defined by sidekiq Creates a model named AsyncTask
to store details about the job like, job_id, status, retry counts etc. When the transaction (inside which job is scheduled) is successfull, the task is schedules as a sidekiq job But in case of an exception, when Rollback is encountered, it doesn't schedule the job.
This model is used to track all AsyncTasks. It has four states: UNINITIATED : it means that only the async task has been created but no job has been pushed to queue. SCHEDULED (default) : jobs has been pushed to queue or will be pushed to queue after transaction commits. STARTED : When the job is picked up to be executed, before the main perform for the worker (perform_with_callback) is called, its state is changed to `started`. COMPLETED : If the job is successful, then the state is changed to `completed` otherwise, it is retried/rescheduled and the retry_count is incremented upon further processing.
Constants
- VERSION