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 Effect.makeAbortSignal #2547

Closed

Conversation

jessekelly881
Copy link
Contributor

@jessekelly881 jessekelly881 commented Apr 17, 2024

Exports existing makeAbortSignal

Copy link

changeset-bot bot commented Apr 17, 2024

🦋 Changeset detected

Latest commit: 2d16dfc

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

This PR includes changesets to release 24 packages
Name Type
effect Minor
@effect/cli Major
@effect/experimental Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/platform Major
@effect/printer-ansi Major
@effect/printer Major
@effect/rpc-http Major
@effect/rpc Major
@effect/schema Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-node Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major
@effect/sql Major
@effect/typeclass Major
@effect/vitest Major

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

@jessekelly881 jessekelly881 changed the base branch from main to next-minor April 17, 2024 02:43
@jessekelly881 jessekelly881 force-pushed the Effect-makeAbortSignal branch 2 times, most recently from e256d16 to 35db16d Compare April 17, 2024 02:59
packages/effect/src/Effect.ts Outdated Show resolved Hide resolved
* Creates an `AbortSignal` that is automatically aborted when the Scope is closed.
* @since 3.1.0
*/
export const makeAbortSignalScoped: Effect<AbortSignal, never, Scope.Scope> = map(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm will think about it. There aren"t many cases where this is useful - usually the signals passed to tryPromise / async are all you need.

Copy link
Contributor Author

@jessekelly881 jessekelly881 Apr 17, 2024

Choose a reason for hiding this comment

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

Typically async and promise are enough. But there have been a few circumstances where I"ve needed a signal inside of an Effect.gen for example.

@github-actions github-actions bot force-pushed the next-minor branch 2 times, most recently from 63909f4 to 78132c7 Compare April 17, 2024 12:52
@jessekelly881 jessekelly881 changed the title Add Effect.makeAbortSignal(Scoped) Add Effect.makeAbortSignal Apr 17, 2024
@github-actions github-actions bot force-pushed the next-minor branch 15 times, most recently from b31dc43 to 925a3f8 Compare April 18, 2024 23:05
@github-actions github-actions bot force-pushed the next-minor branch 2 times, most recently from ed5a635 to 71323be Compare August 8, 2024 15:25
@github-actions github-actions bot force-pushed the next-minor branch 25 times, most recently from aacbb7a to 2234d76 Compare August 20, 2024 23:38
@tim-smart
Copy link
Contributor

Considering this would no longer be used internally, I don"t think we need this addition.

If you feel strongly about adding it, feel free to re-open to discuss.

@tim-smart tim-smart closed this Aug 20, 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