request_store-sidekiq
request_store-sidekiq copied to clipboard
Persist the RequestStore at job execution
If the persist feature is active:
RequestStore::Sidekiq.configure do |config|
# Enable store persistance a job execution.
config.persist = true
end
The RequestStore.store is saved and restored at job execution.
It allows you to save the store for retried jobs or keep the same store for jobs pushed by another job with a store.
This is nice.
(I'm not 100% sure but) one additional thing I'd need before I could use this is a way to strip the serialized RequestStore of certain complex objects that might not be serializable; I know I've run into cases where some 3rd party gem checks for the existence of RequestStore and then adds an object that can't be serialized to JSON because of some cyclical data structure.
Perhaps we can serialize the store in the middleware, then skip not serializable objects.
I'll write a test to reproduce this case.
@cyrill62 Hi, do you have any intention moving this forward? :)
Super late to the party here 🎉 but is there anything new on this that I should be aware of. First off, it's gorgeous code and I can see the need and use case for this, so even with the limitation outlined with cyclical objects I'd be inclined to include and release.
Curious if @cyrill62, have you used this in production on a fork without issues, have more to commit here, etc?
Thanks for all the hard work!