MCPcopy Index your code
hub / github.com/Effect-TS/effect / writePayload

Function writePayload

packages/experimental/src/EventLog.ts:284–297  ·  view source on GitHub ↗
(timestamp: number, tag: string, payload: any)

Source from the content-addressed store, hash-verified

282 events: Object.keys(group.events),
283 effect: Effect.fnUntraced(function*({ entries, write }) {
284 const writePayload = (timestamp: number, tag: string, payload: any) =>
285 Effect.gen(function*() {
286 const event = group.events[tag] as any as Event.AnyWithProps
287 const entry = new Entry({
288 id: makeEntryId({ msecs: timestamp }),
289 event: tag,
290 payload: yield* (Schema.encode(event.payloadMsgPack)(payload).pipe(
291 Effect.locally(FiberRef.currentContext, context),
292 Effect.orDie
293 ) as Effect.Effect<Uint8Array>),
294 primaryKey: event.primaryKey(payload)
295 }, { disableValidation: true })
296 yield* write(entry)
297 })
298
299 const byPrimaryKey = new Map<
300 string,

Callers 1

writeFunction · 0.85

Calls 4

makeEntryIdFunction · 0.85
encodeMethod · 0.80
writeFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…