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

Function resultCodecFor

packages/infra/src/WorkflowEngineSqlite.ts:243–250  ·  view source on GitHub ↗
(workflow: Workflow.Any)

Source from the content-addressed store, hash-verified

241 S.fromJsonString(S.toCodecJson(Workflow.Result({ success: workflow.successSchema, error: workflow.errorSchema })))
242 const resultCodecCache = new Map<string, ReturnType<typeof makeResultCodec>>()
243 const resultCodecFor = (workflow: Workflow.Any) => {
244 let c = resultCodecCache.get(workflow._tag)
245 if (!c) {
246 c = makeResultCodec(workflow)
247 resultCodecCache.set(workflow._tag, c)
248 }
249 return c
250 }
251
252 const encodePayload = (workflow: Workflow.Any, payload: object) =>
253 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…