© 2026 Hedgehog Software, LLC
const rateLimitPolicy = pipe( Schedule.recurs(5), Schedule.whileInput((_: Http.StatusCodeError) => _.status === 429), Schedule.passthrough, Schedule.addDelay(_ => pipe( Option.fromNullable(_.response.headers.get("retry-after")), Option.map(_ => Duration.seconds(+_)), Option.getOrElse(() => Duration.millis(500)), ), ), )
Http.RequestError | Http.StatusCodeError