@effect/platform-bun 0.15.4 → 0.15.6

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.
@@ -43,7 +43,6 @@ const platformWorkerImpl = /*#__PURE__*/Worker__namespace.PlatformWorker.of({
43
43
  });
44
44
  port.postMessage([1]);
45
45
  })));
46
- const fiberId = yield* _(Effect__namespace.fiberId);
47
46
  const queue = yield* _(Queue__namespace.unbounded());
48
47
  const fiber = yield* _(Effect__namespace.async((resume, signal) => {
49
48
  port.addEventListener("message", function (event) {
@@ -56,8 +55,7 @@ const platformWorkerImpl = /*#__PURE__*/Worker__namespace.PlatformWorker.of({
56
55
  }, {
57
56
  signal
58
57
  });
59
- }), Effect__namespace.forkDaemon);
60
- yield* _(Effect__namespace.addFinalizer(() => fiber.interruptAsFork(fiberId)));
58
+ }), Effect__namespace.forkScoped);
61
59
  const join = effect.Fiber.join(fiber);
62
60
  const send = (message, transfers) => Effect__namespace.sync(() => port.postMessage([0, message], transfers));
63
61
  return {
@@ -43,7 +43,6 @@ const platformWorkerImpl = /*#__PURE__*/Worker__namespace.PlatformWorker.of({
43
43
  });
44
44
  port.postMessage([1]);
45
45
  })));
46
- const fiberId = yield* _(Effect__namespace.fiberId);
47
46
  const queue = yield* _(Queue__namespace.unbounded());
48
47
  const fiber = yield* _(Effect__namespace.async((resume, signal) => {
49
48
  port.addEventListener("message", function (event) {
@@ -56,8 +55,7 @@ const platformWorkerImpl = /*#__PURE__*/Worker__namespace.PlatformWorker.of({
56
55
  }, {
57
56
  signal
58
57
  });
59
- }), Effect__namespace.forkDaemon);
60
- yield* _(Effect__namespace.addFinalizer(() => fiber.interruptAsFork(fiberId)));
58
+ }), Effect__namespace.forkScoped);
61
59
  const join = effect.Fiber.join(fiber);
62
60
  const send = (message, transfers) => Effect__namespace.sync(() => port.postMessage([0, message], transfers));
63
61
  return {
@@ -17,7 +17,6 @@ const platformWorkerImpl = /*#__PURE__*/Worker.PlatformWorker.of({
17
17
  });
18
18
  port.postMessage([1]);
19
19
  })));
20
- const fiberId = yield* _(Effect.fiberId);
21
20
  const queue = yield* _(Queue.unbounded());
22
21
  const fiber = yield* _(Effect.async((resume, signal) => {
23
22
  port.addEventListener("message", function (event) {
@@ -30,8 +29,7 @@ const platformWorkerImpl = /*#__PURE__*/Worker.PlatformWorker.of({
30
29
  }, {
31
30
  signal
32
31
  });
33
- }), Effect.forkDaemon);
34
- yield* _(Effect.addFinalizer(() => fiber.interruptAsFork(fiberId)));
32
+ }), Effect.forkScoped);
35
33
  const join = Fiber.join(fiber);
36
34
  const send = (message, transfers) => Effect.sync(() => port.postMessage([0, message], transfers));
37
35
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/platform-bun",
3
- "version": "0.15.4",
3
+ "version": "0.15.6",
4
4
  "description": "Unified interfaces for common platform-specific services",
5
5
  "main": "dist/effect-platform-bun.cjs.js",
6
6
  "module": "dist/effect-platform-bun.esm.js",
@@ -30,8 +30,8 @@
30
30
  "license": "MIT",
31
31
  "sideEffects": false,
32
32
  "dependencies": {
33
- "@effect/platform": "^0.26.2",
34
- "@effect/platform-node": "^0.27.4"
33
+ "@effect/platform": "^0.26.4",
34
+ "@effect/platform-node": "^0.27.6"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@effect/schema": "^0.46.1",
@@ -18,7 +18,6 @@ const platformWorkerImpl = Worker.PlatformWorker.of({
18
18
  })
19
19
  ))
20
20
 
21
- const fiberId = yield* _(Effect.fiberId)
22
21
  const queue = yield* _(Queue.unbounded<Worker.BackingWorker.Message<O>>())
23
22
 
24
23
  const fiber = yield* _(
@@ -30,9 +29,8 @@ const platformWorkerImpl = Worker.PlatformWorker.of({
30
29
  resume(Effect.fail(WorkerError("unknown", event.message)))
31
30
  }, { signal })
32
31
  }),
33
- Effect.forkDaemon
32
+ Effect.forkScoped
34
33
  )
35
- yield* _(Effect.addFinalizer(() => fiber.interruptAsFork(fiberId)))
36
34
  const join = Fiber.join(fiber)
37
35
 
38
36
  const send = (message: I, transfers?: ReadonlyArray<unknown>) =>
@@ -53,4 +53,4 @@ export const layer = Layer.succeed(Runner.PlatformRunner, platformRunnerImpl)
53
53
  export const make = <I, R, E, O>(
54
54
  process: (request: I) => Stream.Stream<R, E, O>,
55
55
  options?: Runner.Runner.Options<O>
56
- ): Effect.Effect<Scope.Scope | R, WorkerError, void> => Effect.provide(Runner.make(process, options), layer)
56
+ ): Effect.Effect<Scope.Scope | R, WorkerError, never> => Effect.provide(Runner.make(process, options), layer)