Comments (7)
Hey there! Thank you for feedback and suggestion; this gem was never designed to be used with ActiveJob, but I will look into your approach and get back to you after next week+! (Currently traveling without a laptop)
from sidekiq-lock.
Sorry for the lag, got back this week!
Did some quick research:
-
as per Sidekiq 6.0 you can use
sidekiq_options
directly; reference -
seems we could use this for obtaining options then
Hmm, so the clean solution would be basically to require at least sidekiq 6.x and do some internal changes so we could support ActiveJob as well seamlessly 🤔 that's a pretty aggressive change tho - I will need to check what's the expected support for Sidekiq 5.x (like in terms of bugfixes) - I can only guess, but I think a lot of people could still use it
from sidekiq-lock.
Yeah, we're using 6.whatever right now, so I'm just putting sidekiq_options
in the job, as if it were a plain Sidekiq worker. That part works the exact same as Workers.
The only part that didn't work before was actually accessing those options from the middleware.
from sidekiq-lock.
Maybe we could just do a version check inside the middleware itself and use sidekiq_options_hash
if version 6 is being used - simply for backward compatibility 🤔 such check shouldn't have too much of an performance impact (micro might be benchmark needed, also I totally forgot when middleware is being initialized - maybe we could do the version check once)
@xxx thanks for bringing that up in the first place! I will try to suggest some solution within this month (hopefully)
from sidekiq-lock.
I am also interested in exploring the ability to have this working with ActiveJob. Anything I can help with?
from sidekiq-lock.
@yrashk hello 👋 I'm kinda swamped with other work atm, if you have time to help that would be great! (the more contributors the merrier)
Let's maybe first prep failing test suite (so using lock inside ActveJob job, not sure what effort we're talking about here tbh 🙈 ) and take it from there - I think we quickly can agree on reasonable implementation that won't break backward compatibility, does that sounds good?
from sidekiq-lock.
Closing this due to lack of interest; maybe I will try to revisit it in next month or two but no promises 🙈
from sidekiq-lock.
Related Issues (15)
- Define custom lock method name
- undefined method for 'lock' HOT 3
- Support inline locking too HOT 3
- Is there a way to use n-locks? HOT 3
- sidekiq_options lock conflicts with sidekiq-unique-jobs gem lock option HOT 4
- Simple example does not work? HOT 13
- Want to initialize multiple locks (mutex) in a single sidekiq job and set there expiration time to infinite. HOT 5
- Sidekiq inline test helper
- Unsupported command argument type: TrueClass HOT 4
- Test with Sidekiq 3.0 HOT 1
- "Infinite" timeout HOT 2
- Proc method doesnt work for timeout HOT 1
- Sidekiq lock not working HOT 5
- Rails fails on start HOT 1
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-lock.