Sidekiq is a Redis-backed Ruby library for creating background jobs.
Obviously, Redis is in memory. Since our tasks are very important, we cannot tolerate "missing" jobs as a consequence of Redis failures (such as sudden shutdown due to electricity issues and so on).
Your task is to create PersistedSidekiq, Redis-backed with DB fallback library for creating background jobs.
- PersistedSidekiq should use Sidekiq internally.
- PersistedSidekiq should have the same API as Sidekiq.
- PersistedSidekiq should be able to recover, automatically, from Redis shutdowns (It means that Redis may be shut down and loose all its data at any time, and PersistedSidekiq will recover).
- Recovery does not need to happen as soon as Redis come back, it may happen a while after.
- PersistedSidekiq is expected to be used in a cluster of workers.
- Upload your code to Github and send us a link.
- Pay careful attention to all the different cases
- The end product should be simple Ruby project (no need for public Gem refinements)
- Every functionality should be tested with the required level. We're not interested in some sort of minimum coverage, we prefer to have the required logic covered.