Skip to content

Commit

Permalink
[bugfix] concurrentFinalizers in Effect.all implementation (#4194)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhraksMamtsov authored Dec 26, 2024
1 parent 16dd657 commit 302b57d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-eagles-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

take concurrentFinalizers option in account in `Effect.all` combinator
12 changes: 8 additions & 4 deletions packages/effect/src/internal/fiberRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,8 @@ const allValidate = (
return core.flatMap(
forEach(eitherEffects, identity, {
concurrency: options?.concurrency,
batching: options?.batching
batching: options?.batching,
concurrentFinalizers: options?.concurrentFinalizers
}),
(eithers) => {
const none = Option.none()
Expand Down Expand Up @@ -1899,14 +1900,16 @@ const allEither = (
return forEach(eitherEffects, identity, {
concurrency: options?.concurrency,
batching: options?.batching,
discard: true
discard: true,
concurrentFinalizers: options?.concurrentFinalizers
})
}

return core.map(
forEach(eitherEffects, identity, {
concurrency: options?.concurrency,
batching: options?.batching
batching: options?.batching,
concurrentFinalizers: options?.concurrentFinalizers
}),
(eithers) =>
reconcile._tag === "Some" ?
Expand Down Expand Up @@ -2579,7 +2582,8 @@ export const validateAll = dual<
core.flatMap(
partition(elements, f, {
concurrency: options?.concurrency,
batching: options?.batching
batching: options?.batching,
concurrentFinalizers: options?.concurrentFinalizers
}),
([es, bs]) =>
es.length === 0
Expand Down

0 comments on commit 302b57d

Please sign in to comment.