Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
add SerializedWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Dec 13, 2023
1 parent 395edc1 commit 1dfe320
Show file tree
Hide file tree
Showing 55 changed files with 1,455 additions and 492 deletions.
8 changes: 8 additions & 0 deletions .changeset/honest-moose-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@effect/platform-browser": patch
"@effect/platform-node": patch
"@effect/platform-bun": patch
"@effect/platform": patch
---

add SerializedWorker
36 changes: 36 additions & 0 deletions docs/platform-browser/Transferable.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Transferable.ts
nav_order: 9
parent: "@effect/platform-browser"
---

## Transferable overview

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).

---

<h2 class="text-delta">Table of contents</h2>

- [exports](#exports)
- [From "@effect/platform/Transferable"](#from-effectplatformtransferable)

---

# exports

## From "@effect/platform/Transferable"

Re-exports all named exports from the "@effect/platform/Transferable" module.

**Signature**

```ts
export * from "@effect/platform/Transferable"
```

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).
29 changes: 28 additions & 1 deletion docs/platform-browser/Worker.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Worker.ts
nav_order: 9
nav_order: 10
parent: "@effect/platform-browser"
---

Expand All @@ -17,6 +17,8 @@ Also includes exports from [`@effect/platform/Worker`](https://effect-ts.github.
- [constructors](#constructors)
- [makePool](#makepool)
- [makePoolLayer](#makepoollayer)
- [makePoolSerialized](#makepoolserialized)
- [makePoolSerializedLayer](#makepoolserializedlayer)
- [exports](#exports)
- [From "@effect/platform/Worker"](#from-effectplatformworker)
- [layers](#layers)
Expand Down Expand Up @@ -52,6 +54,31 @@ export declare const makePoolLayer: <Tag, I, E, O>(
Added in v1.0.0
## makePoolSerialized
**Signature**
```ts
export declare const makePoolSerialized: <I extends Schema.TaggedRequest.Any>(
options: Worker.SerializedWorkerPool.Options<I, Worker | SharedWorker>
) => Effect.Effect<Scope.Scope | Worker.WorkerManager, never, Worker.SerializedWorkerPool<I>>
```
Added in v1.0.0
## makePoolSerializedLayer
**Signature**
```ts
export declare const makePoolSerializedLayer: <Tag, I extends Schema.TaggedRequest.Any>(
tag: Context.Tag<Tag, Worker.SerializedWorkerPool<I>>,
options: Worker.SerializedWorkerPool.Options<I, Worker | SharedWorker>
) => Layer.Layer<never, never, Tag>
```
Added in v1.0.0
# exports
## From "@effect/platform/Worker"
Expand Down
35 changes: 34 additions & 1 deletion docs/platform-browser/WorkerRunner.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: WorkerRunner.ts
nav_order: 10
nav_order: 11
parent: "@effect/platform-browser"
---

Expand All @@ -16,6 +16,7 @@ Also includes exports from [`@effect/platform/WorkerRunner`](https://effect-ts.g

- [constructors](#constructors)
- [make](#make)
- [makeSerialized](#makeserialized)
- [exports](#exports)
- [From "@effect/platform/WorkerRunner"](#from-effectplatformworkerrunner)
- [layers](#layers)
Expand All @@ -38,6 +39,38 @@ export declare const make: <I, R, E, O>(
Added in v1.0.0
## makeSerialized
**Signature**
```ts
export declare const makeSerialized: <
I,
A extends Schema.TaggedRequest.Any,
Handlers extends {
readonly [K in A["_tag"]]: Extract<A, { readonly _tag: K }> extends Serializable.SerializableWithResult<
infer _IS,
infer S,
infer _IE,
infer E,
infer _IO,
infer O
>
? (_: S) => Stream.Stream<any, E, O> | Effect.Effect<any, E, O>
: never
}
>(
schema: Schema.Schema<I, A>,
handlers: Handlers
) => Effect.Effect<
Scope.Scope | (ReturnType<Handlers[keyof Handlers]> extends Stream.Stream<infer R, infer _E, infer _A> ? R : never),
WorkerError,
never
>
```
Added in v1.0.0
# exports
## From "@effect/platform/WorkerRunner"
Expand Down
15 changes: 15 additions & 0 deletions docs/platform-browser/index.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Added in v1.0.0
- [From "./KeyValueStore.js"](#from-keyvaluestorejs)
- [From "./Path.js"](#from-pathjs)
- [From "./Runtime.js"](#from-runtimejs)
- [From "./Transferable.js"](#from-transferablejs)
- [From "./Worker.js"](#from-workerjs)
- [From "./WorkerRunner.js"](#from-workerrunnerjs)

Expand Down Expand Up @@ -115,6 +116,20 @@ export * as Runtime from "./Runtime.js"

Added in v1.0.0

## From "./Transferable.js"

Re-exports all named exports from the "./Transferable.js" module as `Transferable`.

**Signature**

```ts
export * as Transferable from "./Transferable.js"
```

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).

## From "./Worker.js"

Re-exports all named exports from the "./Worker.js" module as `Worker`.
Expand Down
36 changes: 36 additions & 0 deletions docs/platform-bun/Transferable.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Transferable.ts
nav_order: 19
parent: "@effect/platform-bun"
---

## Transferable overview

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).

---

<h2 class="text-delta">Table of contents</h2>

- [exports](#exports)
- [From "@effect/platform/Transferable"](#from-effectplatformtransferable)

---

# exports

## From "@effect/platform/Transferable"

Re-exports all named exports from the "@effect/platform/Transferable" module.

**Signature**

```ts
export * from "@effect/platform/Transferable"
```

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).
29 changes: 28 additions & 1 deletion docs/platform-bun/Worker.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Worker.ts
nav_order: 19
nav_order: 20
parent: "@effect/platform-bun"
---

Expand All @@ -17,6 +17,8 @@ Also includes exports from [`@effect/platform/Worker`](https://effect-ts.github.
- [constructors](#constructors)
- [makePool](#makepool)
- [makePoolLayer](#makepoollayer)
- [makePoolSerialized](#makepoolserialized)
- [makePoolSerializedLayer](#makepoolserializedlayer)
- [exports](#exports)
- [From "@effect/platform/Worker"](#from-effectplatformworker)
- [layers](#layers)
Expand Down Expand Up @@ -52,6 +54,31 @@ export declare const makePoolLayer: <Tag, I, E, O>(
Added in v1.0.0
## makePoolSerialized
**Signature**
```ts
export declare const makePoolSerialized: <I extends Schema.TaggedRequest.Any>(
options: Worker.SerializedWorkerPool.Options<I, Worker>
) => Effect.Effect<Scope.Scope | Worker.WorkerManager, never, Worker.SerializedWorkerPool<I>>
```
Added in v1.0.0
## makePoolSerializedLayer
**Signature**
```ts
export declare const makePoolSerializedLayer: <Tag, I extends Schema.TaggedRequest.Any>(
tag: Context.Tag<Tag, Worker.SerializedWorkerPool<I>>,
options: Worker.SerializedWorkerPool.Options<I, Worker>
) => Layer.Layer<never, never, Tag>
```
Added in v1.0.0
# exports
## From "@effect/platform/Worker"
Expand Down
35 changes: 34 additions & 1 deletion docs/platform-bun/WorkerRunner.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: WorkerRunner.ts
nav_order: 20
nav_order: 21
parent: "@effect/platform-bun"
---

Expand All @@ -16,6 +16,7 @@ Also includes exports from [`@effect/platform/WorkerRunner`](https://effect-ts.g

- [constructors](#constructors)
- [make](#make)
- [makeSerialized](#makeserialized)
- [exports](#exports)
- [From "@effect/platform/WorkerRunner"](#from-effectplatformworkerrunner)
- [layers](#layers)
Expand All @@ -38,6 +39,38 @@ export declare const make: <I, R, E, O>(
Added in v1.0.0
## makeSerialized
**Signature**
```ts
export declare const makeSerialized: <
I,
A extends Schema.TaggedRequest.Any,
Handlers extends {
readonly [K in A["_tag"]]: Extract<A, { readonly _tag: K }> extends Serializable.SerializableWithResult<
infer _IS,
infer S,
infer _IE,
infer E,
infer _IO,
infer O
>
? (_: S) => Stream.Stream<any, E, O> | Effect.Effect<any, E, O>
: never
}
>(
schema: Schema.Schema<I, A>,
handlers: Handlers
) => Effect.Effect<
Scope.Scope | (ReturnType<Handlers[keyof Handlers]> extends Stream.Stream<infer R, infer _E, infer _A> ? R : never),
WorkerError,
never
>
```
Added in v1.0.0
# exports
## From "@effect/platform/WorkerRunner"
Expand Down
15 changes: 15 additions & 0 deletions docs/platform-bun/index.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Added in v1.0.0
- [From "./Sink.js"](#from-sinkjs)
- [From "./Stream.js"](#from-streamjs)
- [From "./Terminal.js"](#from-terminaljs)
- [From "./Transferable.js"](#from-transferablejs)
- [From "./Worker.js"](#from-workerjs)
- [From "./WorkerRunner.js"](#from-workerrunnerjs)

Expand Down Expand Up @@ -204,6 +205,20 @@ export * as Terminal from "./Terminal.js"

Added in v1.0.0

## From "./Transferable.js"

Re-exports all named exports from the "./Transferable.js" module as `Transferable`.

**Signature**

```ts
export * as Transferable from "./Transferable.js"
```

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).

## From "./Worker.js"

Re-exports all named exports from the "./Worker.js" module as `Worker`.
Expand Down
36 changes: 36 additions & 0 deletions docs/platform-node/Transferable.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Transferable.ts
nav_order: 22
parent: "@effect/platform-node"
---

## Transferable overview

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).

---

<h2 class="text-delta">Table of contents</h2>

- [exports](#exports)
- [From "@effect/platform/Transferable"](#from-effectplatformtransferable)

---

# exports

## From "@effect/platform/Transferable"

Re-exports all named exports from the "@effect/platform/Transferable" module.

**Signature**

```ts
export * from "@effect/platform/Transferable"
```

Added in v1.0.0

Also includes exports from [`@effect/platform/Transferable`](https://effect-ts.github.io/platform/platform/Transferable.ts.html).
Loading

0 comments on commit 1dfe320

Please sign in to comment.