MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeRequest

Function makeRequest

packages/cluster/test/Runners.test.ts:65–82  ·  view source on GitHub ↗
(options: { readonly entityId: string; readonly tag: string })

Source from the content-addressed store, hash-verified

63
64describe.concurrent("RunnerServer", () => {
65 const makeRequest = (options: { readonly entityId: string; readonly tag: string }) =>
66 Effect.gen(function*() {
67 const sharding = yield* Sharding.Sharding
68 const snowflakeGen = yield* Snowflake.Generator
69 const entityId = EntityId.make(options.entityId)
70 return {
71 _tag: "Request" as const,
72 requestId: snowflakeGen.unsafeNext(),
73 address: EntityAddress.make({
74 shardId: sharding.getShardId(entityId, BadReplyEntity.getShardGroup(entityId)),
75 entityType: EntityType.EntityType.make("BadReplyEntity"),
76 entityId
77 }),
78 tag: options.tag,
79 payload: { id: 1 },
80 headers: Headers.empty
81 }
82 })
83
84 it.scoped("a reply that fails to serialize fails only its own request", () =>
85 Effect.gen(function*() {

Callers 3

Runners.test.tsFile · 0.70

Calls 3

getShardIdMethod · 0.80
getShardGroupMethod · 0.80
makeMethod · 0.65

Tested by

no test coverage detected