Skip to content

(Breaking) Wrap weight and priority in an options object#78

Open
dmurvihill wants to merge 4 commits into
DirtyHairy:masterfrom
dmurvihill:priority-breaking
Open

(Breaking) Wrap weight and priority in an options object#78
dmurvihill wants to merge 4 commits into
DirtyHairy:masterfrom
dmurvihill:priority-breaking

Conversation

@dmurvihill

Copy link
Copy Markdown
Contributor

Consider merging this next time you choose to publish breaking changes. It wraps the weight and priority options into a single object, preserving the same default values as before.

Users who do not pass the weight or priority arguments should be unaffected.

@DirtyHairy

DirtyHairy commented Mar 12, 2024

Copy link
Copy Markdown
Owner

After thinking about it, I'd rather overload the affected methods to allow both signatures and annotate the old signature as deprecated. This could be released immediately, and we can remove the old signature in a 0.6.0 (or maybe even 1.0.0, I think eight years are long enough for a major release 😏 ).

Comment thread README.md
semaphore.acquire({ weight: 1, priority: 5 }) // Equivalent

semaphore.acquire(2) // Old
semaphore.acquire({ weight: 5 }) // New

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, that's not the same weight!

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.

2 participants