MCPcopy Create free account
hub / github.com/effect-app/libs / replyToDoc

Function replyToDoc

packages/infra/src/ClusterCosmos.ts:301–324  ·  view source on GitHub ↗
(reply: Reply.Encoded)

Source from the content-addressed store, hash-verified

299}
300
301const replyToDoc = (reply: Reply.Encoded): ReplyDoc =>
302 reply._tag === "WithExit"
303 ? {
304 id: cosmosId(reply.id),
305 _partitionKey: replyPartition(reply.requestId),
306 type: "reply",
307 rowid: reply.id,
308 kind: "WithExit",
309 requestId: reply.requestId,
310 payload: reply.exit,
311 sequence: null,
312 acked: false
313 }
314 : {
315 id: cosmosId(reply.id),
316 _partitionKey: replyPartition(reply.requestId),
317 type: "reply",
318 rowid: reply.id,
319 kind: "Chunk",
320 requestId: reply.requestId,
321 payload: reply.values,
322 sequence: reply.sequence,
323 acked: false
324 }
325
326const replyFromDoc = (doc: ReplyDoc): Reply.Encoded =>
327 doc.kind === "WithExit"

Callers 1

ClusterCosmos.tsFile · 0.85

Calls 2

replyPartitionFunction · 0.85
cosmosIdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…