Replies: 3 comments
-
I think not idea 3 and 4 for the reason being that I like being explicit with the required parameters to For idea 2, I am unsure if we want to switch to a struct instead of a method. Idea 1 is the best for me. Slightly more verbose but is clear about the params that can be accepted. One issue is we do not know which ones are required and optional from the |
Beta Was this translation helpful? Give feedback.
-
I agree, idea 1 looks neat and also is clear regarding the params. |
Beta Was this translation helpful? Give feedback.
-
I prefer number 1 of these options. 2 makes it quite different from other options, 4 and 5 both feel a bit weird to me. 3 I think would be fine but is definitely less simple. Would you be able to clarify the intended behaviour of If having context helps, the use case I'd find this useful for is that our scheduling process deliberately duplicates enqeueuing processes in order to ensure continuity if it goes down, or to ensure previous inputs are picked up after a change. This functionality would be really helpful for removing duplicate jobs. |
Beta Was this translation helpful? Give feedback.
-
Several feedbacks on the
Unique
option (#369, #376, and #407) suggest that we need to allow users to specify more than TTL of the uniqueness lock. Some users need to also specify:The
Unique
option is based on the idea that the enqueued task creates a uniqueness lock with a given TTL and it'll be guaranteed to be unique within that time period.Current semantics and its problems
Currently the uniqueness key is generated automatically by
But some users (see #407) would like to specify their own unique key.
Currently the uniqueness lock is released when the task gets successfully processed, but some users (see #369) would like for the lock to stay until the TTL expires.
Suggested Ideas
The
Unique
option should take these as parameters:Since we are still pre v1, we are okay with making breaking changes as long as we document the change in the release notes and changelog.
Here's some of the suggested APIs for the new
Unique
option that I have so far.If anyone has suggestions or feedback on the API, please let me know :)
Beta Was this translation helpful? Give feedback.
All reactions