MCPcopy Create free account
hub / github.com/Effect-TS/effect / jittered

Function jittered

packages/effect/src/Schedule.ts:1093–1100  ·  view source on GitHub ↗
(
  self: Schedule<Output, Input, Error, Env>
)

Source from the content-addressed store, hash-verified

1091 * @since 2.0.0
1092 */
1093export const jittered = <Output, Input, Error, Env>(
1094 self: Schedule<Output, Input, Error, Env>
1095): Schedule<Output, Input, Error, Env> =>
1096 modifyDelay(self, ({ duration }) =>
1097 effect.map(randomNext, (random) => {
1098 const millis = Duration.toMillis(duration)
1099 return Duration.millis(millis * 0.8 * (1 - random) + millis * 1.2 * random)
1100 }))
1101
1102/**
1103 * Returns a new `Schedule` that outputs the inputs of the specified schedule.

Callers

nothing calls this directly

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected