Comments (4)
As object hydration can often raise an error or require the database, this is something out of Sidekiq’s responsibilities IMO. I advise people to use lazy accessors which load the object on demand. Save user_id as an attribute so only the id is persisted to the job.
from sidekiq.
- Already the default. This adds the client middleware in all environments:
sidekiq/lib/sidekiq/middleware/current_attributes.rb
Lines 69 to 74 in 73c150d
2. Sounds intriguing but I'm not sure what that entails. I'd be happy to get a PR or discuss more.
from sidekiq.
Thanks for the answer !
- Sorry I got confused by the
config.client_middleware
, I didn't knew theSidekiq.default_configuration
was configuring both server and client side at the same time - Our problem is that we are using
Current
to pass along objects (for instanceCurrent.agent
) and the current implementation is serializing withto_s
, thus serializing the name of the object rather than the whole object or the id at least. On the server side, theLoad
method is recreating aCurrent.agent
that is not the previousCurrent.agent
but only a string. Maybe it is bad practice to useCurrent
with records, but the doc is actually taking such an example (Current.user
). It would be cool if the module was able to pass along objects/records rather than just strings (unless I only didn't understood how to do it 😬)
from sidekiq.
Alright, I get the point. Thanks for the insight
from sidekiq.
Related Issues (20)
- Google Cloud Logger not compatible with sidekiq 7.2 HOT 2
- ActionMailer::MailDeliveryJob does not play nice out of the box with the `retry_for` logic HOT 2
- Feature Request - Add ActiveSupport::HashWithIndifferentAccess as a safe JSON type HOT 1
- Report recovered jobs on logs (pro/push) HOT 2
- Report pro/push exceptions to exception tracker
- Bucket limiter can be timezone aware with day interval HOT 1
- The incompatible args warning not generated for ActiveSupport::HashWithIndifferentAccess HOT 2
- [suggestion] smarter default rate limit backoff strategy HOT 5
- [Feature request] Ability to customize `(class, args, queue)` list for unique jobs HOT 6
- Payload field inside work from Sidekiq::WorkSet is not hash anymore HOT 2
- [ENT] Rate Limiting Bucket w/ Points HOT 3
- Sidekiq UI not working HOT 4
- Either declare or remove dependency on base64 to avoid a Ruby 3.3 warning HOT 1
- Jobs disappears for 10 seconds when Worker is picking it up HOT 3
- Feature Request: Callbacks/Middlewares for Handling Jobs at Risk of Loss in reliable_push HOT 4
- Sidekiq 7 API Change - Sidekiq[:average_scheduled_poll_interval] HOT 4
- When `perform_bulk` is passed an array arg with size 1, e.g. [[1, 2, 3]] ArgumentError HOT 6
- sidekiq-ent limiter timeouts from redis-client revisited HOT 7
- transactional_push! prevents jobs from being added to a batch HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq.