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

add releaseAll api to Semaphore #2067

Merged
merged 2 commits into from
Feb 7, 2024
Merged

add releaseAll api to Semaphore #2067

merged 2 commits into from
Feb 7, 2024

Conversation

tim-smart
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Feb 7, 2024

🦋 Changeset detected

Latest commit: 5d0700a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
effect Patch
@effect/cli Patch
@effect/experimental Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node Patch
@effect/platform Patch
@effect/printer-ansi Patch
@effect/printer Patch
@effect/rpc-http-node Patch
@effect/rpc-http Patch
@effect/rpc-nextjs Patch
@effect/rpc-workers Patch
@effect/rpc Patch
@effect/schema Patch
@effect/typeclass Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tim-smart tim-smart marked this pull request as draft February 7, 2024 04:59
@tim-smart tim-smart marked this pull request as ready for review February 7, 2024 06:38
@@ -35,7 +35,7 @@ import * as supervisor from "../supervisor.js"

/** @internal */
class Semaphore {
public waiters = new Array<() => void>()
public waiters = new Array<() => boolean>()
Copy link
Member Author

Choose a reason for hiding this comment

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

Benchmarks show using a Set scales much better than an Array for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Insertion order is preserved too, so it is safe to use.

@mikearnaldi mikearnaldi merged commit d0b911c into main Feb 7, 2024
12 checks passed
@mikearnaldi mikearnaldi deleted the semahore-release-all branch February 7, 2024 18:01
@github-actions github-actions bot mentioned this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants