effect 4.0.0-beta.26 → 4.0.0-beta.28
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.
- package/dist/Cause.d.ts +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Data.d.ts +3 -3
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +2 -2
- package/dist/Data.js.map +1 -1
- package/dist/Effect.d.ts +331 -206
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +113 -72
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +1 -1
- package/dist/ErrorReporter.d.ts +2 -4
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +1 -3
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/Exit.d.ts +24 -12
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -4
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +1 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/Graph.d.ts +1 -1
- package/dist/Layer.d.ts +112 -117
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +43 -44
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +4 -4
- package/dist/LayerMap.js +3 -3
- package/dist/ManagedRuntime.d.ts +1 -1
- package/dist/ManagedRuntime.js +1 -1
- package/dist/Metric.d.ts +2 -4
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +2 -4
- package/dist/Metric.js.map +1 -1
- package/dist/PlatformError.d.ts +2 -2
- package/dist/References.d.ts +6 -1
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +6 -1
- package/dist/References.js.map +1 -1
- package/dist/RequestResolver.d.ts +19 -19
- package/dist/RequestResolver.js +10 -10
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Schedule.d.ts +144 -82
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +58 -32
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +9 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +11 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +3 -1
- package/dist/Schema.js.map +1 -1
- package/dist/Stdio.d.ts +6 -2
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -2
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +8 -4
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +8 -4
- package/dist/Stream.js.map +1 -1
- package/dist/Types.d.ts +1 -22
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js +3 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +12 -28
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +4 -18
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +20 -1
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +8 -0
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +65 -12
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +159 -45
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +4 -11
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +0 -5
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +4 -4
- package/dist/unstable/cli/CliError.js +4 -4
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Prompt.js +31 -0
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +5 -5
- package/dist/unstable/cluster/Reply.d.ts +3 -3
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +1 -1
- package/dist/unstable/encoding/Sse.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/http/Cookies.d.ts +45 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +22 -0
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +16 -0
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +11 -0
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +5 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +21 -17
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +7 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +6 -0
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +6 -6
- package/dist/unstable/http/HttpServerRequest.d.ts +11 -0
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +291 -1
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +47 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +227 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
- package/dist/unstable/http/HttpStaticServer.js +353 -0
- package/dist/unstable/http/HttpStaticServer.js.map +1 -0
- package/dist/unstable/http/Multipart.d.ts +1 -1
- package/dist/unstable/http/UrlParams.d.ts +1 -1
- package/dist/unstable/http/index.d.ts +4 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +4 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +5 -0
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +1 -0
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +4 -10
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -6
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +39 -9
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +8 -8
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +46 -20
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +5 -5
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +2 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.js +1 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +21 -0
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +15 -0
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlResolver.js +2 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +1 -1
- package/package.json +1 -1
- package/src/Cause.ts +1 -1
- package/src/Data.ts +3 -4
- package/src/Effect.ts +331 -206
- package/src/ErrorReporter.ts +2 -4
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +1 -0
- package/src/Layer.ts +112 -117
- package/src/LayerMap.ts +4 -4
- package/src/ManagedRuntime.ts +1 -1
- package/src/Metric.ts +2 -4
- package/src/References.ts +6 -1
- package/src/RequestResolver.ts +20 -20
- package/src/Schedule.ts +144 -82
- package/src/Scheduler.ts +12 -0
- package/src/Schema.ts +3 -1
- package/src/Stdio.ts +8 -4
- package/src/Stream.ts +8 -4
- package/src/Types.ts +1 -23
- package/src/index.ts +5 -3
- package/src/internal/effect.ts +3 -0
- package/src/unstable/ai/LanguageModel.ts +16 -37
- package/src/unstable/ai/McpSchema.ts +14 -0
- package/src/unstable/ai/McpServer.ts +224 -53
- package/src/unstable/ai/Toolkit.ts +5 -14
- package/src/unstable/ai/internal/codec-transformer.ts +0 -7
- package/src/unstable/cli/CliError.ts +4 -4
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +27 -0
- package/src/unstable/http/Cookies.ts +84 -0
- package/src/unstable/http/Headers.ts +34 -0
- package/src/unstable/http/HttpClientRequest.ts +21 -17
- package/src/unstable/http/HttpEffect.ts +8 -0
- package/src/unstable/http/HttpServerRequest.ts +388 -1
- package/src/unstable/http/HttpServerResponse.ts +328 -1
- package/src/unstable/http/HttpStaticServer.ts +456 -0
- package/src/unstable/http/index.ts +5 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +3 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +1 -0
- package/src/unstable/reactivity/Atom.ts +20 -26
- package/src/unstable/reactivity/AtomHttpApi.ts +45 -11
- package/src/unstable/reactivity/AtomRpc.ts +48 -17
- package/src/unstable/rpc/Rpc.ts +1 -3
- package/src/unstable/rpc/RpcMiddleware.ts +12 -6
- package/src/unstable/rpc/RpcServer.ts +2 -2
- package/src/unstable/rpc/Utils.ts +1 -1
- package/src/unstable/schema/Model.ts +31 -0
- package/src/unstable/sql/SqlResolver.ts +2 -2
package/src/LayerMap.ts
CHANGED
|
@@ -27,7 +27,7 @@ const TypeId = "~effect/LayerMap"
|
|
|
27
27
|
* // Create a LayerMap that provides different database configurations
|
|
28
28
|
* const createDatabaseLayerMap = LayerMap.make((env: string) =>
|
|
29
29
|
* Layer.succeed(DatabaseService)({
|
|
30
|
-
* query: (sql) => Effect.succeed(`${env}: ${sql}`)
|
|
30
|
+
* query: Effect.fn("DatabaseService.query")((sql) => Effect.succeed(`${env}: ${sql}`))
|
|
31
31
|
* })
|
|
32
32
|
* )
|
|
33
33
|
*
|
|
@@ -91,7 +91,7 @@ export interface LayerMap<in out K, in out I, in out E = never> {
|
|
|
91
91
|
* const layerMap = yield* LayerMap.make(
|
|
92
92
|
* (env: string) =>
|
|
93
93
|
* Layer.succeed(DatabaseService)({
|
|
94
|
-
* query: (sql) => Effect.succeed(`${env}: ${sql}`)
|
|
94
|
+
* query: Effect.fn("DatabaseService.query")((sql) => Effect.succeed(`${env}: ${sql}`))
|
|
95
95
|
* }),
|
|
96
96
|
* { idleTimeToLive: "5 seconds" }
|
|
97
97
|
* )
|
|
@@ -171,10 +171,10 @@ export const make: <
|
|
|
171
171
|
* // Create predefined layers
|
|
172
172
|
* const layers = {
|
|
173
173
|
* development: Layer.succeed(DevDatabase)({
|
|
174
|
-
* query: (sql) => Effect.succeed(`DEV: ${sql}`)
|
|
174
|
+
* query: Effect.fn("DevDatabase.query")((sql) => Effect.succeed(`DEV: ${sql}`))
|
|
175
175
|
* }),
|
|
176
176
|
* production: Layer.succeed(ProdDatabase)({
|
|
177
|
-
* query: (sql) => Effect.succeed(`PROD: ${sql}`)
|
|
177
|
+
* query: Effect.fn("ProdDatabase.query")((sql) => Effect.succeed(`PROD: ${sql}`))
|
|
178
178
|
* })
|
|
179
179
|
* } as const
|
|
180
180
|
*
|
package/src/ManagedRuntime.ts
CHANGED
|
@@ -141,7 +141,7 @@ export interface ManagedRuntime<in R, out ER> {
|
|
|
141
141
|
* readonly notify: (message: string) => Effect.Effect<void>
|
|
142
142
|
* }>()("Notifications") {
|
|
143
143
|
* static readonly layer = Layer.succeed(this)({
|
|
144
|
-
* notify: (message) => Console.log(message)
|
|
144
|
+
* notify: Effect.fn("Notifications.notify")((message) => Console.log(message))
|
|
145
145
|
* })
|
|
146
146
|
* }
|
|
147
147
|
*
|
package/src/Metric.ts
CHANGED
|
@@ -4801,7 +4801,7 @@ export const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService = {
|
|
|
4801
4801
|
* Effect.gen(function*() {
|
|
4802
4802
|
* yield* Effect.sleep(`${50 + id * 10} millis`)
|
|
4803
4803
|
* if (id % 7 === 0) {
|
|
4804
|
-
* yield*
|
|
4804
|
+
* return yield* new AppError({ operation: `fetch-user-${id}` })
|
|
4805
4805
|
* }
|
|
4806
4806
|
* return { id, name: `User ${id}`, email: `user${id}@example.com` }
|
|
4807
4807
|
* })
|
|
@@ -4940,9 +4940,7 @@ export const disableRuntimeMetricsLayer = Layer.succeed(FiberRuntimeMetrics)(und
|
|
|
4940
4940
|
* yield* Effect.sleep(`${100 + i * 50} millis`)
|
|
4941
4941
|
* if (i % 4 === 0) {
|
|
4942
4942
|
* // Simulate some failures
|
|
4943
|
-
* yield*
|
|
4944
|
-
* new RuntimeMetricsError({ operation: `task-${i}` })
|
|
4945
|
-
* )
|
|
4943
|
+
* return yield* new RuntimeMetricsError({ operation: `task-${i}` })
|
|
4946
4944
|
* }
|
|
4947
4945
|
* return `Task ${i} completed`
|
|
4948
4946
|
* }).pipe(
|
package/src/References.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { constTrue, constUndefined } from "./Function.ts"
|
|
14
14
|
import type { LogLevel, Severity } from "./LogLevel.ts"
|
|
15
15
|
import type { ReadonlyRecord } from "./Record.ts"
|
|
16
|
-
import { MaxOpsBeforeYield } from "./Scheduler.ts"
|
|
16
|
+
import { MaxOpsBeforeYield, PreventSchedulerYield } from "./Scheduler.ts"
|
|
17
17
|
import * as ServiceMap from "./ServiceMap.ts"
|
|
18
18
|
import { CurrentTraceLevel, DisablePropagation, MinimumTraceLevel, type SpanLink, Tracer } from "./Tracer.ts"
|
|
19
19
|
|
|
@@ -38,6 +38,11 @@ export {
|
|
|
38
38
|
* @category references
|
|
39
39
|
*/
|
|
40
40
|
MinimumTraceLevel,
|
|
41
|
+
/**
|
|
42
|
+
* @since 4.0.0
|
|
43
|
+
* @category references
|
|
44
|
+
*/
|
|
45
|
+
PreventSchedulerYield,
|
|
41
46
|
/**
|
|
42
47
|
* @since 4.0.0
|
|
43
48
|
* @category references
|
package/src/RequestResolver.ts
CHANGED
|
@@ -181,7 +181,7 @@ const defaultKey = (_request: unknown): unknown => defaultKeyObject
|
|
|
181
181
|
* )
|
|
182
182
|
*
|
|
183
183
|
* // Use the resolver to handle requests
|
|
184
|
-
* const getUserEffect = Effect.request(GetUserRequest({ id: 123 }),
|
|
184
|
+
* const getUserEffect = Effect.request(GetUserRequest({ id: 123 }), UserResolver)
|
|
185
185
|
* ```
|
|
186
186
|
*
|
|
187
187
|
* @since 2.0.0
|
|
@@ -276,7 +276,7 @@ const hashGroupKey = <A, K>(get: (entry: Request.Entry<A>) => K) => {
|
|
|
276
276
|
* // Usage
|
|
277
277
|
* const getSquareEffect = Effect.request(
|
|
278
278
|
* GetSquareRequest({ value: 5 }),
|
|
279
|
-
*
|
|
279
|
+
* SquareResolver
|
|
280
280
|
* )
|
|
281
281
|
* // Will resolve to 25
|
|
282
282
|
* ```
|
|
@@ -319,7 +319,7 @@ export const fromFunction = <A extends Request.Any>(
|
|
|
319
319
|
*
|
|
320
320
|
* // Usage with multiple requests
|
|
321
321
|
* const effects = [1, 2, 3].map((value) =>
|
|
322
|
-
* Effect.request(GetDoubleRequest({ value }),
|
|
322
|
+
* Effect.request(GetDoubleRequest({ value }), DoubleResolver)
|
|
323
323
|
* )
|
|
324
324
|
* const batchedEffect = Effect.all(effects) // [2, 4, 6]
|
|
325
325
|
* ```
|
|
@@ -370,7 +370,7 @@ export const fromFunctionBatched = <A extends Request.Any>(
|
|
|
370
370
|
* // Usage
|
|
371
371
|
* const getUserEffect = Effect.request(
|
|
372
372
|
* GetUserFromAPIRequest({ id: 123 }),
|
|
373
|
-
*
|
|
373
|
+
* UserAPIResolver
|
|
374
374
|
* )
|
|
375
375
|
* ```
|
|
376
376
|
*
|
|
@@ -874,7 +874,7 @@ export const never: RequestResolver<never> = make(() => Effect.never)
|
|
|
874
874
|
* // When more than 5 requests are made, they'll be split into multiple batches
|
|
875
875
|
* const requests = Array.from(
|
|
876
876
|
* { length: 12 },
|
|
877
|
-
* (_, i) => Effect.request(GetDataRequest({ id: i }),
|
|
877
|
+
* (_, i) => Effect.request(GetDataRequest({ id: i }), limitedResolver)
|
|
878
878
|
* )
|
|
879
879
|
* ```
|
|
880
880
|
*
|
|
@@ -910,7 +910,7 @@ export const batchN: {
|
|
|
910
910
|
* // When more than 5 requests are made, they'll be split into multiple batches
|
|
911
911
|
* const requests = Array.from(
|
|
912
912
|
* { length: 12 },
|
|
913
|
-
* (_, i) => Effect.request(GetDataRequest({ id: i }),
|
|
913
|
+
* (_, i) => Effect.request(GetDataRequest({ id: i }), limitedResolver)
|
|
914
914
|
* )
|
|
915
915
|
* ```
|
|
916
916
|
*
|
|
@@ -946,7 +946,7 @@ export const batchN: {
|
|
|
946
946
|
* // When more than 5 requests are made, they'll be split into multiple batches
|
|
947
947
|
* const requests = Array.from(
|
|
948
948
|
* { length: 12 },
|
|
949
|
-
* (_, i) => Effect.request(GetDataRequest({ id: i }),
|
|
949
|
+
* (_, i) => Effect.request(GetDataRequest({ id: i }), limitedResolver)
|
|
950
950
|
* )
|
|
951
951
|
* ```
|
|
952
952
|
*
|
|
@@ -994,15 +994,15 @@ export const batchN: {
|
|
|
994
994
|
* const requests = [
|
|
995
995
|
* Effect.request(
|
|
996
996
|
* GetUserRequest({ userId: 1, department: "Engineering" }),
|
|
997
|
-
*
|
|
997
|
+
* groupedResolver
|
|
998
998
|
* ),
|
|
999
999
|
* Effect.request(
|
|
1000
1000
|
* GetUserRequest({ userId: 2, department: "Engineering" }),
|
|
1001
|
-
*
|
|
1001
|
+
* groupedResolver
|
|
1002
1002
|
* ),
|
|
1003
1003
|
* Effect.request(
|
|
1004
1004
|
* GetUserRequest({ userId: 3, department: "Marketing" }),
|
|
1005
|
-
*
|
|
1005
|
+
* groupedResolver
|
|
1006
1006
|
* )
|
|
1007
1007
|
* ]
|
|
1008
1008
|
* ```
|
|
@@ -1045,15 +1045,15 @@ export const grouped: {
|
|
|
1045
1045
|
* const requests = [
|
|
1046
1046
|
* Effect.request(
|
|
1047
1047
|
* GetUserRequest({ userId: 1, department: "Engineering" }),
|
|
1048
|
-
*
|
|
1048
|
+
* groupedResolver
|
|
1049
1049
|
* ),
|
|
1050
1050
|
* Effect.request(
|
|
1051
1051
|
* GetUserRequest({ userId: 2, department: "Engineering" }),
|
|
1052
|
-
*
|
|
1052
|
+
* groupedResolver
|
|
1053
1053
|
* ),
|
|
1054
1054
|
* Effect.request(
|
|
1055
1055
|
* GetUserRequest({ userId: 3, department: "Marketing" }),
|
|
1056
|
-
*
|
|
1056
|
+
* groupedResolver
|
|
1057
1057
|
* )
|
|
1058
1058
|
* ]
|
|
1059
1059
|
* ```
|
|
@@ -1096,15 +1096,15 @@ export const grouped: {
|
|
|
1096
1096
|
* const requests = [
|
|
1097
1097
|
* Effect.request(
|
|
1098
1098
|
* GetUserRequest({ userId: 1, department: "Engineering" }),
|
|
1099
|
-
*
|
|
1099
|
+
* groupedResolver
|
|
1100
1100
|
* ),
|
|
1101
1101
|
* Effect.request(
|
|
1102
1102
|
* GetUserRequest({ userId: 2, department: "Engineering" }),
|
|
1103
|
-
*
|
|
1103
|
+
* groupedResolver
|
|
1104
1104
|
* ),
|
|
1105
1105
|
* Effect.request(
|
|
1106
1106
|
* GetUserRequest({ userId: 3, department: "Marketing" }),
|
|
1107
|
-
*
|
|
1107
|
+
* groupedResolver
|
|
1108
1108
|
* )
|
|
1109
1109
|
* ]
|
|
1110
1110
|
* ```
|
|
@@ -1300,7 +1300,7 @@ export const race: {
|
|
|
1300
1300
|
* )
|
|
1301
1301
|
*
|
|
1302
1302
|
* // Spans will automatically include batch size and request links
|
|
1303
|
-
* const effect = Effect.request(GetDataRequest({ id: 123 }),
|
|
1303
|
+
* const effect = Effect.request(GetDataRequest({ id: 123 }), tracedResolver)
|
|
1304
1304
|
* ```
|
|
1305
1305
|
*
|
|
1306
1306
|
* @since 4.0.0
|
|
@@ -1342,7 +1342,7 @@ export const withSpan: {
|
|
|
1342
1342
|
* )
|
|
1343
1343
|
*
|
|
1344
1344
|
* // Spans will automatically include batch size and request links
|
|
1345
|
-
* const effect = Effect.request(GetDataRequest({ id: 123 }),
|
|
1345
|
+
* const effect = Effect.request(GetDataRequest({ id: 123 }), tracedResolver)
|
|
1346
1346
|
* ```
|
|
1347
1347
|
*
|
|
1348
1348
|
* @since 4.0.0
|
|
@@ -1387,7 +1387,7 @@ export const withSpan: {
|
|
|
1387
1387
|
* )
|
|
1388
1388
|
*
|
|
1389
1389
|
* // Spans will automatically include batch size and request links
|
|
1390
|
-
* const effect = Effect.request(GetDataRequest({ id: 123 }),
|
|
1390
|
+
* const effect = Effect.request(GetDataRequest({ id: 123 }), tracedResolver)
|
|
1391
1391
|
* ```
|
|
1392
1392
|
*
|
|
1393
1393
|
* @since 4.0.0
|
|
@@ -1509,7 +1509,7 @@ export const asCache: {
|
|
|
1509
1509
|
capacity: options.capacity,
|
|
1510
1510
|
timeToLive: options.timeToLive as any,
|
|
1511
1511
|
requireServicesAt: options.requireServicesAt ?? "lookup" as ServiceMode,
|
|
1512
|
-
lookup: (req: A) => internal.request(req,
|
|
1512
|
+
lookup: (req: A) => internal.request(req, self)
|
|
1513
1513
|
}) as any)
|
|
1514
1514
|
|
|
1515
1515
|
/**
|