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

Function resultCodecFor

packages/infra/src/WorkflowEngineCosmos.ts:210–217  ·  view source on GitHub ↗
(workflow: Workflow.Any)

Source from the content-addressed store, hash-verified

208 S.fromJsonString(S.toCodecJson(Workflow.Result({ success: workflow.successSchema, error: workflow.errorSchema })))
209 const resultCodecCache = new Map<string, ReturnType<typeof makeResultCodec>>()
210 const resultCodecFor = (workflow: Workflow.Any) => {
211 let c = resultCodecCache.get(workflow._tag)
212 if (!c) {
213 c = makeResultCodec(workflow)
214 resultCodecCache.set(workflow._tag, c)
215 }
216 return c
217 }
218
219 const encodePayload = (workflow: Workflow.Any, payload: object) =>
220 Effect.orDie(S.encodeEffect(payloadCodecFor(workflow))(payload)) as Effect.Effect<string>

Callers 2

encodeResultFunction · 0.70
decodeResultFunction · 0.70

Calls 3

makeResultCodecFunction · 0.70
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…