effect 3.2.3 → 3.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -218,12 +218,15 @@ class PoolImpl<in out A, in out E> implements Pool.Pool<A, E> {
218
218
  const release = (attempted: Attempted<A, E>): Effect.Effect<unknown> =>
219
219
  core.exitMatch(attempted.result, {
220
220
  onFailure: () =>
221
- core.flatten(ref.modify(this.state, (state) => {
222
- if (state.size <= this.min) {
223
- return [allocateUinterruptible(this), { ...state, free: state.free + 1 }] as const
224
- }
225
- return [core.void, { ...state, size: state.size - 1 }] as const
226
- })),
221
+ core.zipRight(
222
+ attempted.finalizer,
223
+ core.flatten(ref.modify(this.state, (state) => {
224
+ if (state.size <= this.min) {
225
+ return [allocateUinterruptible(this), { ...state, free: state.free + 1 }] as const
226
+ }
227
+ return [core.void, { ...state, size: state.size - 1 }] as const
228
+ }))
229
+ ),
227
230
  onSuccess: (item) =>
228
231
  core.flatMap(ref.get(this.invalidated), (set) => {
229
232
  if (pipe(set, HashSet.has(item))) {
@@ -6555,7 +6555,7 @@ export const toReadableStreamRuntime = dual<
6555
6555
  <A, E, XR, R extends XR>(self: Stream.Stream<A, E, R>, runtime: Runtime.Runtime<XR>) => ReadableStream<A>
6556
6556
  >(2, <A, E, XR, R extends XR>(self: Stream.Stream<A, E, R>, runtime: Runtime.Runtime<XR>): ReadableStream<A> => {
6557
6557
  const runSync = Runtime.runSync(runtime)
6558
- const runPromise = Runtime.runPromise(runtime)
6558
+ const runFork = Runtime.runFork(runtime)
6559
6559
 
6560
6560
  let pull: Effect.Effect<void, never, R>
6561
6561
  let scope: Scope.CloseableScope
@@ -6588,10 +6588,14 @@ export const toReadableStreamRuntime = dual<
6588
6588
  )
6589
6589
  },
6590
6590
  pull() {
6591
- return runPromise(pull)
6591
+ return new Promise<void>((resolve) => {
6592
+ runFork(pull, { scope }).addObserver((_) => resolve())
6593
+ })
6592
6594
  },
6593
6595
  cancel() {
6594
- return runPromise(Scope.close(scope, Exit.void))
6596
+ return new Promise<void>((resolve) => {
6597
+ runFork(Scope.close(scope, Exit.void)).addObserver((_) => resolve())
6598
+ })
6595
6599
  }
6596
6600
  })
6597
6601
  })
@@ -1,4 +1,4 @@
1
- let moduleVersion = "3.2.3"
1
+ let moduleVersion = "3.2.5"
2
2
 
3
3
  export const getCurrentVersion = () => moduleVersion
4
4