@effect/platform
Advanced tools
Comparing version
@@ -134,3 +134,3 @@ "use strict"; | ||
const handleMessages = yield* _(Queue.take(backing.queue), Effect.flatMap(handleMessage), Effect.forever, Effect.forkScoped); | ||
const postMessages = yield* _(semaphore.take(1), Effect.zipRight(outbound.take), Effect.flatMap(([id, request]) => (0, _Function.pipe)(Effect.suspend(() => { | ||
const postMessages = (0, _Function.pipe)(semaphore.take(1), Effect.zipRight(outbound.take), Effect.flatMap(([id, request]) => (0, _Function.pipe)(Effect.suspend(() => { | ||
const result = requestMap.get(id); | ||
@@ -141,4 +141,5 @@ if (!result) return Effect.unit; | ||
return Effect.zipRight(Effect.catchAllCause(backing.send([id, 0, payload], transferables), cause => Queue.offer(result[0], Exit.failCause(cause))), Deferred.await(result[1])); | ||
}), Effect.ensuring(semaphore.release(1)), Effect.fork)), Effect.forever, Effect.forkScoped); | ||
const join = Fiber.joinAll([backing.fiber, handleMessages, postMessages]); | ||
}), Effect.ensuring(semaphore.release(1)), Effect.fork)), Effect.forever); | ||
const postMessagesFiber = yield* _(Deferred.await(readyLatch), Effect.zipRight(postMessages), Effect.forkScoped); | ||
const join = Fiber.joinAll([backing.fiber, handleMessages, postMessagesFiber]); | ||
return { | ||
@@ -145,0 +146,0 @@ id, |
@@ -102,3 +102,3 @@ import * as Cause from "effect/Cause"; | ||
const handleMessages = yield* _(Queue.take(backing.queue), Effect.flatMap(handleMessage), Effect.forever, Effect.forkScoped); | ||
const postMessages = yield* _(semaphore.take(1), Effect.zipRight(outbound.take), Effect.flatMap(([id, request]) => pipe(Effect.suspend(() => { | ||
const postMessages = pipe(semaphore.take(1), Effect.zipRight(outbound.take), Effect.flatMap(([id, request]) => pipe(Effect.suspend(() => { | ||
const result = requestMap.get(id); | ||
@@ -109,4 +109,5 @@ if (!result) return Effect.unit; | ||
return Effect.zipRight(Effect.catchAllCause(backing.send([id, 0, payload], transferables), cause => Queue.offer(result[0], Exit.failCause(cause))), Deferred.await(result[1])); | ||
}), Effect.ensuring(semaphore.release(1)), Effect.fork)), Effect.forever, Effect.forkScoped); | ||
const join = Fiber.joinAll([backing.fiber, handleMessages, postMessages]); | ||
}), Effect.ensuring(semaphore.release(1)), Effect.fork)), Effect.forever); | ||
const postMessagesFiber = yield* _(Deferred.await(readyLatch), Effect.zipRight(postMessages), Effect.forkScoped); | ||
const join = Fiber.joinAll([backing.fiber, handleMessages, postMessagesFiber]); | ||
return { | ||
@@ -113,0 +114,0 @@ id, |
{ | ||
"name": "@effect/platform", | ||
"version": "0.30.4", | ||
"version": "0.30.5", | ||
"description": "Unified interfaces for common platform-specific services", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -184,3 +184,3 @@ import * as Cause from "effect/Cause" | ||
const postMessages = yield* _( | ||
const postMessages = pipe( | ||
semaphore.take(1), | ||
@@ -207,7 +207,12 @@ Effect.zipRight(outbound.take), | ||
), | ||
Effect.forever, | ||
Effect.forever | ||
) | ||
const postMessagesFiber = yield* _( | ||
Deferred.await(readyLatch), | ||
Effect.zipRight(postMessages), | ||
Effect.forkScoped | ||
) | ||
const join = Fiber.joinAll([backing.fiber, handleMessages, postMessages]) as Effect.Effect< | ||
const join = Fiber.joinAll([backing.fiber, handleMessages, postMessagesFiber]) as Effect.Effect< | ||
never, | ||
@@ -214,0 +219,0 @@ WorkerError, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1238971
0.05%22132
0.03%