Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requaos/unique jobs #27

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

requaos
Copy link

@requaos requaos commented Apr 19, 2019

No description provided.

fetcher.go Outdated Show resolved Hide resolved
@requaos
Copy link
Author

requaos commented Mar 20, 2020

This feature sat around for awhile and missed out on being included in the store interface... any recommendations on if there are any special methods to add there? maybe a method to get a list of all uniquely enqueued jobs?

@requaos
Copy link
Author

requaos commented Mar 20, 2020

@stefannegrea Also, since the shift to a store interface, I just removed my modification to the Acknowledge method. If we are enqueueing a unique job, it checks before insert if there is already a job in that queue with the same args. I had code tucked under the Acknowledge method to LRem with a count of 0 so it nukes all elements with that set of args. It was for safety that I put the guard on both ends, but I guess it really only needs it on insert. If we actually wanted that behavior, would you be willing to bend on that interface definition? If so, would you prefer passing an integer directly or a boolean for unique on non-unique?

@requaos
Copy link
Author

requaos commented Mar 31, 2020

You can merge this whenever you want, if you want.

@hellozimi
Copy link

Nice job @requaos! What's the status on getting this in @stefannegrea?

case nil:
val, err := message.Get("unique").Bool()
if err == nil && val {
rc := mgr.opts.client
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to avoid using the Redis client directly at this layer. What are the additional store functions that are needed to support this functionality?

As we stated a few years ago, we are moving in the direction of implementing at least one more additional persistent storage engine to go-workers2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants