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

Function updateInfo

packages/effect/src/internal/schedule.ts:104–129  ·  view source on GitHub ↗
(
  iterationMetaRef: Ref.Ref<Schedule.IterationMetadata>,
  now: number,
  input: unknown,
  output: unknown
)

Source from the content-addressed store, hash-verified

102
103/** @internal */
104const updateInfo = (
105 iterationMetaRef: Ref.Ref<Schedule.IterationMetadata>,
106 now: number,
107 input: unknown,
108 output: unknown
109) =>
110 ref.update(iterationMetaRef, (prev) =>
111 (prev.recurrence === 0) ?
112 {
113 now,
114 input,
115 output,
116 recurrence: prev.recurrence + 1,
117 elapsed: Duration.zero,
118 elapsedSincePrevious: Duration.zero,
119 start: now
120 } :
121 {
122 now,
123 input,
124 output,
125 recurrence: prev.recurrence + 1,
126 elapsed: Duration.millis(now - prev.start),
127 elapsedSincePrevious: Duration.millis(now - prev.now),
128 start: prev.start
129 })
130
131/** @internal */
132class ScheduleDriverImpl<Out, In, R> implements Schedule.ScheduleDriver<Out, In, R> {

Callers 1

nextMethod · 0.85

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected