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

Support consumer-provided task keys #18

Closed
2 tasks done
isabo opened this issue Dec 17, 2015 · 0 comments
Closed
2 tasks done

Support consumer-provided task keys #18

isabo opened this issue Dec 17, 2015 · 0 comments
Milestone

Comments

@isabo
Copy link
Owner

isabo commented Dec 17, 2015

This will allow a consumer to prevent duplicates in a very simple way.

  • Provide a way to replace a task with another bearing the same ID. Without a special way to do this, it will not be possible to schedule a continuation task from the processor of a task with the same ID. (Actually it is possible, using ID's that incorporate time-window counters, but that's inconvenient). How about throw new RescheduleTask() or done(new RescheduleTask())? - No, call schedule in the usual way, and it should just work - maybe with a flag to override the duplicate ID error.
  • Tests
@isabo isabo added this to the v1.0 milestone Dec 17, 2015
isabo added a commit that referenced this issue Dec 21, 2015
- Specify an ID when scheduling a task to guarantee that only one such
task will exist. This is to make it easy to prevent duplicates.
- Change rescheduling mechanism to update the `_dueAt` time and the
number of `_attempts` on the existing task object, instead of deleting
one task and creating another.

Most of the work required by #18
isabo added a commit that referenced this issue Dec 22, 2015
* Specify task ID
* Reschedule tasks
* Use a random queue ref to avoid pollution by previous failed tests

See #18
@isabo isabo closed this as completed in ac22e62 Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant