effect 4.0.0-beta.27 → 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/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Data.d.ts +1 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/Effect.d.ts +300 -184
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +99 -61
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +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/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 +142 -80
- 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 +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- 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/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/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/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/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/Data.ts +1 -2
- package/src/Effect.ts +300 -184
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +1 -0
- package/src/References.ts +6 -1
- package/src/RequestResolver.ts +20 -20
- package/src/Schedule.ts +142 -80
- 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 +4 -2
- 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/Prompt.ts +27 -0
- package/src/unstable/http/Cookies.ts +84 -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/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/sql/SqlResolver.ts +2 -2
package/src/Exit.ts
CHANGED
|
@@ -857,10 +857,12 @@ export const map: {
|
|
|
857
857
|
* **Example** (Mapping over an error)
|
|
858
858
|
*
|
|
859
859
|
* ```ts
|
|
860
|
-
* import { Exit } from "effect"
|
|
860
|
+
* import { Data, Exit } from "effect"
|
|
861
|
+
*
|
|
862
|
+
* class ExitError extends Data.TaggedError("ExitError")<{ readonly input: string }> {}
|
|
861
863
|
*
|
|
862
864
|
* const exit = Exit.fail("bad input")
|
|
863
|
-
* const mapped = Exit.mapError(exit, (e) => new
|
|
865
|
+
* const mapped = Exit.mapError(exit, (e) => new ExitError({ input: e }))
|
|
864
866
|
* console.log(Exit.isFailure(mapped)) // true
|
|
865
867
|
* ```
|
|
866
868
|
*
|
|
@@ -884,10 +886,12 @@ export const mapError: {
|
|
|
884
886
|
* **Example** (Mapping over an error)
|
|
885
887
|
*
|
|
886
888
|
* ```ts
|
|
887
|
-
* import { Exit } from "effect"
|
|
889
|
+
* import { Data, Exit } from "effect"
|
|
890
|
+
*
|
|
891
|
+
* class ExitError extends Data.TaggedError("ExitError")<{ readonly input: string }> {}
|
|
888
892
|
*
|
|
889
893
|
* const exit = Exit.fail("bad input")
|
|
890
|
-
* const mapped = Exit.mapError(exit, (e) => new
|
|
894
|
+
* const mapped = Exit.mapError(exit, (e) => new ExitError({ input: e }))
|
|
891
895
|
* console.log(Exit.isFailure(mapped)) // true
|
|
892
896
|
* ```
|
|
893
897
|
*
|
|
@@ -911,10 +915,12 @@ export const mapError: {
|
|
|
911
915
|
* **Example** (Mapping over an error)
|
|
912
916
|
*
|
|
913
917
|
* ```ts
|
|
914
|
-
* import { Exit } from "effect"
|
|
918
|
+
* import { Data, Exit } from "effect"
|
|
919
|
+
*
|
|
920
|
+
* class ExitError extends Data.TaggedError("ExitError")<{ readonly input: string }> {}
|
|
915
921
|
*
|
|
916
922
|
* const exit = Exit.fail("bad input")
|
|
917
|
-
* const mapped = Exit.mapError(exit, (e) => new
|
|
923
|
+
* const mapped = Exit.mapError(exit, (e) => new ExitError({ input: e }))
|
|
918
924
|
* console.log(Exit.isFailure(mapped)) // true
|
|
919
925
|
* ```
|
|
920
926
|
*
|
|
@@ -941,12 +947,14 @@ export const mapError: {
|
|
|
941
947
|
* **Example** (Mapping both channels)
|
|
942
948
|
*
|
|
943
949
|
* ```ts
|
|
944
|
-
* import { Exit } from "effect"
|
|
950
|
+
* import { Data, Exit } from "effect"
|
|
951
|
+
*
|
|
952
|
+
* class ExitError extends Data.TaggedError("ExitError")<{ readonly input: string }> {}
|
|
945
953
|
*
|
|
946
954
|
* const exit = Exit.succeed(42)
|
|
947
955
|
* const mapped = Exit.mapBoth(exit, {
|
|
948
956
|
* onSuccess: (x) => String(x),
|
|
949
|
-
* onFailure: (e: string) => new
|
|
957
|
+
* onFailure: (e: string) => new ExitError({ input: e })
|
|
950
958
|
* })
|
|
951
959
|
* console.log(Exit.isSuccess(mapped) && mapped.value) // "42"
|
|
952
960
|
* ```
|
|
@@ -972,12 +980,14 @@ export const mapBoth: {
|
|
|
972
980
|
* **Example** (Mapping both channels)
|
|
973
981
|
*
|
|
974
982
|
* ```ts
|
|
975
|
-
* import { Exit } from "effect"
|
|
983
|
+
* import { Data, Exit } from "effect"
|
|
984
|
+
*
|
|
985
|
+
* class ExitError extends Data.TaggedError("ExitError")<{ readonly input: string }> {}
|
|
976
986
|
*
|
|
977
987
|
* const exit = Exit.succeed(42)
|
|
978
988
|
* const mapped = Exit.mapBoth(exit, {
|
|
979
989
|
* onSuccess: (x) => String(x),
|
|
980
|
-
* onFailure: (e: string) => new
|
|
990
|
+
* onFailure: (e: string) => new ExitError({ input: e })
|
|
981
991
|
* })
|
|
982
992
|
* console.log(Exit.isSuccess(mapped) && mapped.value) // "42"
|
|
983
993
|
* ```
|
|
@@ -1005,12 +1015,14 @@ export const mapBoth: {
|
|
|
1005
1015
|
* **Example** (Mapping both channels)
|
|
1006
1016
|
*
|
|
1007
1017
|
* ```ts
|
|
1008
|
-
* import { Exit } from "effect"
|
|
1018
|
+
* import { Data, Exit } from "effect"
|
|
1019
|
+
*
|
|
1020
|
+
* class ExitError extends Data.TaggedError("ExitError")<{ readonly input: string }> {}
|
|
1009
1021
|
*
|
|
1010
1022
|
* const exit = Exit.succeed(42)
|
|
1011
1023
|
* const mapped = Exit.mapBoth(exit, {
|
|
1012
1024
|
* onSuccess: (x) => String(x),
|
|
1013
|
-
* onFailure: (e: string) => new
|
|
1025
|
+
* onFailure: (e: string) => new ExitError({ input: e })
|
|
1014
1026
|
* })
|
|
1015
1027
|
* console.log(Exit.isSuccess(mapped) && mapped.value) // "42"
|
|
1016
1028
|
* ```
|
package/src/Fiber.ts
CHANGED
|
@@ -128,6 +128,7 @@ export interface Fiber<out A, out E = never> extends Pipeable {
|
|
|
128
128
|
readonly minimumLogLevel: LogLevel
|
|
129
129
|
readonly currentStackFrame?: StackFrame | undefined
|
|
130
130
|
readonly maxOpsBeforeYield: number
|
|
131
|
+
readonly currentPreventYield: boolean
|
|
131
132
|
readonly addObserver: (cb: (exit: Exit<A, E>) => void) => () => void
|
|
132
133
|
readonly interruptUnsafe: (
|
|
133
134
|
fiberId?: number | undefined,
|
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
|
/**
|