Have you thought about creating something like sidekiq’s batches with success/failure events?
In my experience with these types of frameworks, doing things in the background you often need a way to chain things together.
Building a youtube like site:
- User uploads video -> video uploaded method runs in background
- Video uploaded method wants to do 3 things in parallel (convert the video, create thumbnails, inspect content)
- When all those things finish, you want to send an email.
If you had a feature like sidekiq you could batch this up, do everything in parallel, and have the mail message wait for completion/failure of the previous three messages.
You could model this several ways, one being just an
Enqueue(IEnumerable<Expression<Action>> tasks, Expression<Action> success, Expression<Action> failure>) .
Or create interface that the class must inherit from or just a new Batch api.