effect 3.12.11 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -49
- package/dist/cjs/Channel.js.map +1 -1
- package/dist/cjs/DateTime.js +17 -1
- package/dist/cjs/DateTime.js.map +1 -1
- package/dist/cjs/Differ.js.map +1 -1
- package/dist/cjs/Duration.js +128 -1
- package/dist/cjs/Duration.js.map +1 -1
- package/dist/cjs/Effect.js +175 -37
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +2 -1
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/FiberHandle.js +54 -21
- package/dist/cjs/FiberHandle.js.map +1 -1
- package/dist/cjs/FiberMap.js +51 -24
- package/dist/cjs/FiberMap.js.map +1 -1
- package/dist/cjs/FiberSet.js +50 -17
- package/dist/cjs/FiberSet.js.map +1 -1
- package/dist/cjs/HashMap.js +19 -1
- package/dist/cjs/HashMap.js.map +1 -1
- package/dist/cjs/HashSet.js +9 -1
- package/dist/cjs/HashSet.js.map +1 -1
- package/dist/cjs/Layer.js +21 -1
- package/dist/cjs/Layer.js.map +1 -1
- package/dist/cjs/Match.js +659 -38
- package/dist/cjs/Match.js.map +1 -1
- package/dist/cjs/RcMap.js +11 -1
- package/dist/cjs/RcMap.js.map +1 -1
- package/dist/cjs/Reloadable.js.map +1 -1
- package/dist/cjs/STM.js.map +1 -1
- package/dist/cjs/Schedule.js +1074 -309
- package/dist/cjs/Schedule.js.map +1 -1
- package/dist/cjs/Schema.js +73 -1
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/internal/channel.js.map +1 -1
- package/dist/cjs/internal/core-effect.js.map +1 -1
- package/dist/cjs/internal/core.js +27 -3
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/dateTime.js +4 -1
- package/dist/cjs/internal/dateTime.js.map +1 -1
- package/dist/cjs/internal/differ.js +4 -0
- package/dist/cjs/internal/differ.js.map +1 -1
- package/dist/cjs/internal/effect/circular.js +3 -2
- package/dist/cjs/internal/effect/circular.js.map +1 -1
- package/dist/cjs/internal/fiberRuntime.js +21 -7
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/hashMap.js +10 -1
- package/dist/cjs/internal/hashMap.js.map +1 -1
- package/dist/cjs/internal/keyedPool.js +1 -1
- package/dist/cjs/internal/keyedPool.js.map +1 -1
- package/dist/cjs/internal/layer.js.map +1 -1
- package/dist/cjs/internal/rcMap.js +86 -56
- package/dist/cjs/internal/rcMap.js.map +1 -1
- package/dist/cjs/internal/reloadable.js.map +1 -1
- package/dist/cjs/internal/schedule.js.map +1 -1
- package/dist/cjs/internal/sink.js.map +1 -1
- package/dist/cjs/internal/stm/stm.js.map +1 -1
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/Channel.d.ts +4 -4
- package/dist/dts/Channel.d.ts.map +1 -1
- package/dist/dts/DateTime.d.ts +16 -0
- package/dist/dts/DateTime.d.ts.map +1 -1
- package/dist/dts/Differ.d.ts +2 -1
- package/dist/dts/Differ.d.ts.map +1 -1
- package/dist/dts/Duration.d.ts +64 -0
- package/dist/dts/Duration.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts +402 -30
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +7 -0
- package/dist/dts/Either.d.ts.map +1 -1
- package/dist/dts/FiberHandle.d.ts +26 -0
- package/dist/dts/FiberHandle.d.ts.map +1 -1
- package/dist/dts/FiberMap.d.ts +26 -0
- package/dist/dts/FiberMap.d.ts.map +1 -1
- package/dist/dts/FiberSet.d.ts +25 -0
- package/dist/dts/FiberSet.d.ts.map +1 -1
- package/dist/dts/HashMap.d.ts +38 -0
- package/dist/dts/HashMap.d.ts.map +1 -1
- package/dist/dts/HashSet.d.ts +7 -0
- package/dist/dts/HashSet.d.ts.map +1 -1
- package/dist/dts/Layer.d.ts +32 -13
- package/dist/dts/Layer.d.ts.map +1 -1
- package/dist/dts/Match.d.ts +731 -48
- package/dist/dts/Match.d.ts.map +1 -1
- package/dist/dts/RcMap.d.ts +32 -0
- package/dist/dts/RcMap.d.ts.map +1 -1
- package/dist/dts/Reloadable.d.ts +13 -13
- package/dist/dts/Reloadable.d.ts.map +1 -1
- package/dist/dts/STM.d.ts +4 -4
- package/dist/dts/STM.d.ts.map +1 -1
- package/dist/dts/Schedule.d.ts +2294 -633
- package/dist/dts/Schedule.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts +40 -4
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +8 -8
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/Trie.d.ts +7 -7
- package/dist/dts/Trie.d.ts.map +1 -1
- package/dist/dts/index.d.ts +25 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/stm/stm.d.ts +2 -2
- package/dist/dts/internal/stm/stm.d.ts.map +1 -1
- package/dist/esm/Channel.js.map +1 -1
- package/dist/esm/DateTime.js +16 -0
- package/dist/esm/DateTime.js.map +1 -1
- package/dist/esm/Differ.js.map +1 -1
- package/dist/esm/Duration.js +124 -0
- package/dist/esm/Duration.js.map +1 -1
- package/dist/esm/Effect.js +170 -32
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +7 -0
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/FiberHandle.js +48 -18
- package/dist/esm/FiberHandle.js.map +1 -1
- package/dist/esm/FiberMap.js +46 -22
- package/dist/esm/FiberMap.js.map +1 -1
- package/dist/esm/FiberSet.js +45 -15
- package/dist/esm/FiberSet.js.map +1 -1
- package/dist/esm/HashMap.js +17 -0
- package/dist/esm/HashMap.js.map +1 -1
- package/dist/esm/HashSet.js +7 -0
- package/dist/esm/HashSet.js.map +1 -1
- package/dist/esm/Layer.js +20 -0
- package/dist/esm/Layer.js.map +1 -1
- package/dist/esm/Match.js +665 -40
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/RcMap.js +10 -0
- package/dist/esm/RcMap.js.map +1 -1
- package/dist/esm/Reloadable.js.map +1 -1
- package/dist/esm/STM.js.map +1 -1
- package/dist/esm/Schedule.js +1074 -309
- package/dist/esm/Schedule.js.map +1 -1
- package/dist/esm/Schema.js +71 -0
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/index.js +25 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/channel.js.map +1 -1
- package/dist/esm/internal/core-effect.js.map +1 -1
- package/dist/esm/internal/core.js +23 -0
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/dateTime.js +2 -0
- package/dist/esm/internal/dateTime.js.map +1 -1
- package/dist/esm/internal/differ.js +4 -0
- package/dist/esm/internal/differ.js.map +1 -1
- package/dist/esm/internal/effect/circular.js +3 -2
- package/dist/esm/internal/effect/circular.js.map +1 -1
- package/dist/esm/internal/fiberRuntime.js +18 -5
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/hashMap.js +9 -0
- package/dist/esm/internal/hashMap.js.map +1 -1
- package/dist/esm/internal/keyedPool.js +1 -1
- package/dist/esm/internal/keyedPool.js.map +1 -1
- package/dist/esm/internal/layer.js.map +1 -1
- package/dist/esm/internal/rcMap.js +85 -55
- package/dist/esm/internal/rcMap.js.map +1 -1
- package/dist/esm/internal/reloadable.js.map +1 -1
- package/dist/esm/internal/schedule.js.map +1 -1
- package/dist/esm/internal/sink.js.map +1 -1
- package/dist/esm/internal/stm/stm.js.map +1 -1
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/dist/esm/internal/version.js.map +1 -1
- package/package.json +2 -1
- package/src/Channel.ts +14 -17
- package/src/DateTime.ts +17 -8
- package/src/Differ.ts +2 -1
- package/src/Duration.ts +147 -0
- package/src/Effect.ts +528 -140
- package/src/Either.ts +9 -0
- package/src/FiberHandle.ts +95 -35
- package/src/FiberMap.ts +104 -39
- package/src/FiberSet.ts +93 -24
- package/src/HashMap.ts +40 -0
- package/src/HashSet.ts +8 -0
- package/src/Layer.ts +94 -40
- package/src/Match.ts +733 -49
- package/src/RcMap.ts +34 -0
- package/src/Reloadable.ts +17 -27
- package/src/STM.ts +10 -17
- package/src/Schedule.ts +2325 -653
- package/src/Schema.ts +81 -4
- package/src/Stream.ts +26 -33
- package/src/Trie.ts +7 -7
- package/src/index.ts +25 -0
- package/src/internal/channel.ts +37 -39
- package/src/internal/core-effect.ts +84 -84
- package/src/internal/core.ts +80 -0
- package/src/internal/dateTime.ts +3 -0
- package/src/internal/differ.ts +4 -0
- package/src/internal/effect/circular.ts +3 -2
- package/src/internal/fiberRuntime.ts +31 -6
- package/src/internal/hashMap.ts +16 -0
- package/src/internal/keyedPool.ts +1 -1
- package/src/internal/layer.ts +52 -52
- package/src/internal/rcMap.ts +131 -89
- package/src/internal/reloadable.ts +25 -28
- package/src/internal/schedule.ts +29 -23
- package/src/internal/sink.ts +16 -15
- package/src/internal/stm/stm.ts +54 -46
- package/src/internal/stream.ts +100 -100
- package/src/internal/version.ts +1 -1
package/dist/dts/Schedule.d.ts
CHANGED
|
@@ -18,27 +18,45 @@ import type * as Intervals from "./ScheduleIntervals.js";
|
|
|
18
18
|
import type * as Types from "./Types.js";
|
|
19
19
|
/**
|
|
20
20
|
* @since 2.0.0
|
|
21
|
-
* @category
|
|
21
|
+
* @category Symbols
|
|
22
22
|
*/
|
|
23
23
|
export declare const ScheduleTypeId: unique symbol;
|
|
24
24
|
/**
|
|
25
25
|
* @since 2.0.0
|
|
26
|
-
* @category
|
|
26
|
+
* @category Symbols
|
|
27
27
|
*/
|
|
28
28
|
export type ScheduleTypeId = typeof ScheduleTypeId;
|
|
29
29
|
/**
|
|
30
30
|
* @since 2.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Symbols
|
|
32
32
|
*/
|
|
33
33
|
export declare const ScheduleDriverTypeId: unique symbol;
|
|
34
34
|
/**
|
|
35
35
|
* @since 2.0.0
|
|
36
|
-
* @category
|
|
36
|
+
* @category Symbols
|
|
37
37
|
*/
|
|
38
38
|
export type ScheduleDriverTypeId = typeof ScheduleDriverTypeId;
|
|
39
39
|
/**
|
|
40
|
-
* A `Schedule<Out, In, R>` defines a recurring schedule, which consumes
|
|
41
|
-
*
|
|
40
|
+
* A `Schedule<Out, In, R>` defines a recurring schedule, which consumes values
|
|
41
|
+
* of type `In`, and which returns values of type `Out`.
|
|
42
|
+
*
|
|
43
|
+
* The `Schedule` type is structured as follows:
|
|
44
|
+
*
|
|
45
|
+
* ```text
|
|
46
|
+
* ┌─── The type of output produced by the schedule
|
|
47
|
+
* │ ┌─── The type of input consumed by the schedule
|
|
48
|
+
* │ │ ┌─── Additional requirements for the schedule
|
|
49
|
+
* ▼ ▼ ▼
|
|
50
|
+
* Schedule<Out, In, Requirements>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* A schedule operates by consuming values of type `In` (such as errors in the
|
|
54
|
+
* case of `Effect.retry`, or values in the case of `Effect.repeat`) and
|
|
55
|
+
* producing values of type `Out`. It determines when to halt or continue the
|
|
56
|
+
* execution based on input values and its internal state.
|
|
57
|
+
*
|
|
58
|
+
* The inclusion of a `Requirements` parameter allows the schedule to leverage
|
|
59
|
+
* additional services or resources as needed.
|
|
42
60
|
*
|
|
43
61
|
* Schedules are defined as a possibly infinite set of intervals spread out over
|
|
44
62
|
* time. Each interval defines a window in which recurrence is possible.
|
|
@@ -47,11 +65,14 @@ export type ScheduleDriverTypeId = typeof ScheduleDriverTypeId;
|
|
|
47
65
|
* each interval produced by a schedule is used as the moment when the effect
|
|
48
66
|
* will be executed again.
|
|
49
67
|
*
|
|
50
|
-
* Schedules
|
|
68
|
+
* Schedules can be composed in different ways:
|
|
51
69
|
*
|
|
52
|
-
* - Union:
|
|
53
|
-
*
|
|
54
|
-
* -
|
|
70
|
+
* - Union: Combines two schedules and recurs if either schedule wants to
|
|
71
|
+
* continue, using the shorter delay.
|
|
72
|
+
* - Intersection: Combines two schedules and recurs only if both schedules want
|
|
73
|
+
* to continue, using the longer delay.
|
|
74
|
+
* - Sequencing: Combines two schedules by running the first one fully, then
|
|
75
|
+
* switching to the second.
|
|
55
76
|
*
|
|
56
77
|
* In addition, schedule inputs and outputs can be transformed, filtered (to
|
|
57
78
|
* terminate a schedule early in response to some input or output), and so
|
|
@@ -61,7 +82,7 @@ export type ScheduleDriverTypeId = typeof ScheduleDriverTypeId;
|
|
|
61
82
|
* and the companion object for `Schedule` contains all common types of
|
|
62
83
|
* schedules, both for performing retrying, as well as performing repetition.
|
|
63
84
|
*
|
|
64
|
-
* @category
|
|
85
|
+
* @category Model
|
|
65
86
|
* @since 2.0.0
|
|
66
87
|
*/
|
|
67
88
|
export interface Schedule<out Out, in In = unknown, out R = never> extends Schedule.Variance<Out, In, R>, Pipeable {
|
|
@@ -80,7 +101,7 @@ export interface Schedule<out Out, in In = unknown, out R = never> extends Sched
|
|
|
80
101
|
export declare namespace Schedule {
|
|
81
102
|
/**
|
|
82
103
|
* @since 2.0.0
|
|
83
|
-
* @category
|
|
104
|
+
* @category Models
|
|
84
105
|
*/
|
|
85
106
|
interface Variance<out Out, in In, out R> {
|
|
86
107
|
readonly [ScheduleTypeId]: {
|
|
@@ -102,7 +123,7 @@ export declare namespace Schedule {
|
|
|
102
123
|
}
|
|
103
124
|
/**
|
|
104
125
|
* @since 2.0.0
|
|
105
|
-
* @category
|
|
126
|
+
* @category Models
|
|
106
127
|
*/
|
|
107
128
|
export interface ScheduleDriver<out Out, in In = unknown, out R = never> extends Schedule.DriverVariance<Out, In, R> {
|
|
108
129
|
readonly state: Effect.Effect<unknown>;
|
|
@@ -111,530 +132,1147 @@ export interface ScheduleDriver<out Out, in In = unknown, out R = never> extends
|
|
|
111
132
|
next(input: In): Effect.Effect<Out, Option.Option<never>, R>;
|
|
112
133
|
}
|
|
113
134
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
135
|
+
* Creates a new schedule with a custom state and step function.
|
|
136
|
+
*
|
|
137
|
+
* **Details**
|
|
138
|
+
*
|
|
139
|
+
* This function constructs a `Schedule` by defining its initial state and a
|
|
140
|
+
* step function, which determines how the schedule progresses over time. The
|
|
141
|
+
* step function is called on each iteration with the current time, an input
|
|
142
|
+
* value, and the schedule's current state. It returns the next state, an output
|
|
143
|
+
* value, and a decision on whether the schedule should continue or stop.
|
|
144
|
+
*
|
|
145
|
+
* This function is useful for creating custom scheduling logic that goes beyond
|
|
146
|
+
* predefined schedules like fixed intervals or exponential backoff. It allows
|
|
147
|
+
* full control over how the schedule behaves at each step.
|
|
116
148
|
*
|
|
117
149
|
* @since 2.0.0
|
|
118
|
-
* @category
|
|
150
|
+
* @category Constructors
|
|
119
151
|
*/
|
|
120
152
|
export declare const makeWithState: <S, In, Out, R = never>(initial: S, step: (now: number, input: In, state: S) => Effect.Effect<readonly [S, Out, ScheduleDecision.ScheduleDecision], never, R>) => Schedule<Out, In, R>;
|
|
121
153
|
/**
|
|
122
|
-
*
|
|
154
|
+
* Checks whether a given value is a `Schedule`.
|
|
123
155
|
*
|
|
124
156
|
* @since 2.0.0
|
|
125
|
-
* @category
|
|
157
|
+
* @category Guards
|
|
126
158
|
*/
|
|
127
159
|
export declare const isSchedule: (u: unknown) => u is Schedule<unknown, never, unknown>;
|
|
128
160
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
161
|
+
* Adds a delay to every interval in a schedule.
|
|
162
|
+
*
|
|
163
|
+
* **Details**
|
|
164
|
+
*
|
|
165
|
+
* This function modifies a given schedule by applying an additional delay to
|
|
166
|
+
* every interval it defines. The delay is determined by the provided function,
|
|
167
|
+
* which takes the schedule's output and returns a delay duration.
|
|
168
|
+
*
|
|
169
|
+
* @see {@link addDelayEffect} If you need to compute the delay using an effectful function.
|
|
131
170
|
*
|
|
132
171
|
* @since 2.0.0
|
|
133
|
-
* @category
|
|
172
|
+
* @category Timing & Delay
|
|
134
173
|
*/
|
|
135
174
|
export declare const addDelay: {
|
|
136
175
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
176
|
+
* Adds a delay to every interval in a schedule.
|
|
177
|
+
*
|
|
178
|
+
* **Details**
|
|
179
|
+
*
|
|
180
|
+
* This function modifies a given schedule by applying an additional delay to
|
|
181
|
+
* every interval it defines. The delay is determined by the provided function,
|
|
182
|
+
* which takes the schedule's output and returns a delay duration.
|
|
183
|
+
*
|
|
184
|
+
* @see {@link addDelayEffect} If you need to compute the delay using an effectful function.
|
|
139
185
|
*
|
|
140
186
|
* @since 2.0.0
|
|
141
|
-
* @category
|
|
187
|
+
* @category Timing & Delay
|
|
142
188
|
*/
|
|
143
189
|
<Out>(f: (out: Out) => Duration.DurationInput): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
144
190
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
191
|
+
* Adds a delay to every interval in a schedule.
|
|
192
|
+
*
|
|
193
|
+
* **Details**
|
|
194
|
+
*
|
|
195
|
+
* This function modifies a given schedule by applying an additional delay to
|
|
196
|
+
* every interval it defines. The delay is determined by the provided function,
|
|
197
|
+
* which takes the schedule's output and returns a delay duration.
|
|
198
|
+
*
|
|
199
|
+
* @see {@link addDelayEffect} If you need to compute the delay using an effectful function.
|
|
147
200
|
*
|
|
148
201
|
* @since 2.0.0
|
|
149
|
-
* @category
|
|
202
|
+
* @category Timing & Delay
|
|
150
203
|
*/
|
|
151
204
|
<Out, In, R>(self: Schedule<Out, In, R>, f: (out: Out) => Duration.DurationInput): Schedule<Out, In, R>;
|
|
152
205
|
};
|
|
153
206
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
207
|
+
* Adds an effectfully computed delay to every interval in a schedule.
|
|
208
|
+
*
|
|
209
|
+
* **Details**
|
|
210
|
+
*
|
|
211
|
+
* This function modifies a given schedule by applying an additional delay to
|
|
212
|
+
* each interval, where the delay is determined by an effectful function. The
|
|
213
|
+
* function takes the schedule’s output and returns an effect that produces a
|
|
214
|
+
* delay duration.
|
|
215
|
+
*
|
|
216
|
+
* @see {@link addDelay} If you need to compute the delay using a pure function.
|
|
156
217
|
*
|
|
157
218
|
* @since 2.0.0
|
|
158
|
-
* @category
|
|
219
|
+
* @category Timing & Delay
|
|
159
220
|
*/
|
|
160
221
|
export declare const addDelayEffect: {
|
|
161
222
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
223
|
+
* Adds an effectfully computed delay to every interval in a schedule.
|
|
224
|
+
*
|
|
225
|
+
* **Details**
|
|
226
|
+
*
|
|
227
|
+
* This function modifies a given schedule by applying an additional delay to
|
|
228
|
+
* each interval, where the delay is determined by an effectful function. The
|
|
229
|
+
* function takes the schedule’s output and returns an effect that produces a
|
|
230
|
+
* delay duration.
|
|
231
|
+
*
|
|
232
|
+
* @see {@link addDelay} If you need to compute the delay using a pure function.
|
|
164
233
|
*
|
|
165
234
|
* @since 2.0.0
|
|
166
|
-
* @category
|
|
235
|
+
* @category Timing & Delay
|
|
167
236
|
*/
|
|
168
237
|
<Out, R2>(f: (out: Out) => Effect.Effect<Duration.DurationInput, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
169
238
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
239
|
+
* Adds an effectfully computed delay to every interval in a schedule.
|
|
240
|
+
*
|
|
241
|
+
* **Details**
|
|
242
|
+
*
|
|
243
|
+
* This function modifies a given schedule by applying an additional delay to
|
|
244
|
+
* each interval, where the delay is determined by an effectful function. The
|
|
245
|
+
* function takes the schedule’s output and returns an effect that produces a
|
|
246
|
+
* delay duration.
|
|
247
|
+
*
|
|
248
|
+
* @see {@link addDelay} If you need to compute the delay using a pure function.
|
|
172
249
|
*
|
|
173
250
|
* @since 2.0.0
|
|
174
|
-
* @category
|
|
251
|
+
* @category Timing & Delay
|
|
175
252
|
*/
|
|
176
253
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, f: (out: Out) => Effect.Effect<Duration.DurationInput, never, R2>): Schedule<Out, In, R | R2>;
|
|
177
254
|
};
|
|
178
255
|
/**
|
|
179
|
-
*
|
|
256
|
+
* Runs two schedules sequentially, merging their outputs.
|
|
257
|
+
*
|
|
258
|
+
* **Details**
|
|
259
|
+
*
|
|
260
|
+
* This function executes two schedules one after the other. The first schedule
|
|
261
|
+
* runs to completion, and then the second schedule begins execution. Unlike
|
|
262
|
+
* {@link andThenEither}, this function merges the outputs instead of wrapping
|
|
263
|
+
* them in `Either`, allowing both schedules to contribute their results
|
|
264
|
+
* directly.
|
|
265
|
+
*
|
|
266
|
+
* This is useful when a workflow consists of two phases where the second phase
|
|
267
|
+
* should start only after the first one has fully completed.
|
|
268
|
+
*
|
|
269
|
+
* @see {@link andThenEither} If you need to keep track of which schedule
|
|
270
|
+
* produced each result.
|
|
180
271
|
*
|
|
181
272
|
* @since 2.0.0
|
|
182
|
-
* @category
|
|
273
|
+
* @category Sequential Composition
|
|
183
274
|
*/
|
|
184
275
|
export declare const andThen: {
|
|
185
276
|
/**
|
|
186
|
-
*
|
|
277
|
+
* Runs two schedules sequentially, merging their outputs.
|
|
278
|
+
*
|
|
279
|
+
* **Details**
|
|
280
|
+
*
|
|
281
|
+
* This function executes two schedules one after the other. The first schedule
|
|
282
|
+
* runs to completion, and then the second schedule begins execution. Unlike
|
|
283
|
+
* {@link andThenEither}, this function merges the outputs instead of wrapping
|
|
284
|
+
* them in `Either`, allowing both schedules to contribute their results
|
|
285
|
+
* directly.
|
|
286
|
+
*
|
|
287
|
+
* This is useful when a workflow consists of two phases where the second phase
|
|
288
|
+
* should start only after the first one has fully completed.
|
|
289
|
+
*
|
|
290
|
+
* @see {@link andThenEither} If you need to keep track of which schedule
|
|
291
|
+
* produced each result.
|
|
187
292
|
*
|
|
188
293
|
* @since 2.0.0
|
|
189
|
-
* @category
|
|
294
|
+
* @category Sequential Composition
|
|
190
295
|
*/
|
|
191
296
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out2 | Out, In & In2, R2 | R>;
|
|
192
297
|
/**
|
|
193
|
-
*
|
|
298
|
+
* Runs two schedules sequentially, merging their outputs.
|
|
299
|
+
*
|
|
300
|
+
* **Details**
|
|
301
|
+
*
|
|
302
|
+
* This function executes two schedules one after the other. The first schedule
|
|
303
|
+
* runs to completion, and then the second schedule begins execution. Unlike
|
|
304
|
+
* {@link andThenEither}, this function merges the outputs instead of wrapping
|
|
305
|
+
* them in `Either`, allowing both schedules to contribute their results
|
|
306
|
+
* directly.
|
|
307
|
+
*
|
|
308
|
+
* This is useful when a workflow consists of two phases where the second phase
|
|
309
|
+
* should start only after the first one has fully completed.
|
|
310
|
+
*
|
|
311
|
+
* @see {@link andThenEither} If you need to keep track of which schedule
|
|
312
|
+
* produced each result.
|
|
194
313
|
*
|
|
195
314
|
* @since 2.0.0
|
|
196
|
-
* @category
|
|
315
|
+
* @category Sequential Composition
|
|
197
316
|
*/
|
|
198
317
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<Out | Out2, In & In2, R | R2>;
|
|
199
318
|
};
|
|
200
319
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
320
|
+
* Runs two schedules sequentially, collecting results in an `Either`.
|
|
321
|
+
*
|
|
322
|
+
* **Details**
|
|
323
|
+
*
|
|
324
|
+
* This function combines two schedules in sequence. The first schedule runs to
|
|
325
|
+
* completion, and then the second schedule starts and runs to completion as
|
|
326
|
+
* well. The outputs of both schedules are collected into an `Either` structure:
|
|
327
|
+
* - `Either.Left` contains the output of the second schedule.
|
|
328
|
+
* - `Either.Right` contains the output of the first schedule.
|
|
329
|
+
*
|
|
330
|
+
* This is useful when you need to switch from one schedule to another after the
|
|
331
|
+
* first one finishes, while still keeping track of which schedule produced each
|
|
332
|
+
* result.
|
|
333
|
+
*
|
|
334
|
+
* @see {@link andThen} If you need to merge the outputs of both schedules.
|
|
203
335
|
*
|
|
204
336
|
* @since 2.0.0
|
|
205
|
-
* @category
|
|
337
|
+
* @category Sequential Composition
|
|
206
338
|
*/
|
|
207
339
|
export declare const andThenEither: {
|
|
208
340
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
341
|
+
* Runs two schedules sequentially, collecting results in an `Either`.
|
|
342
|
+
*
|
|
343
|
+
* **Details**
|
|
344
|
+
*
|
|
345
|
+
* This function combines two schedules in sequence. The first schedule runs to
|
|
346
|
+
* completion, and then the second schedule starts and runs to completion as
|
|
347
|
+
* well. The outputs of both schedules are collected into an `Either` structure:
|
|
348
|
+
* - `Either.Left` contains the output of the second schedule.
|
|
349
|
+
* - `Either.Right` contains the output of the first schedule.
|
|
350
|
+
*
|
|
351
|
+
* This is useful when you need to switch from one schedule to another after the
|
|
352
|
+
* first one finishes, while still keeping track of which schedule produced each
|
|
353
|
+
* result.
|
|
354
|
+
*
|
|
355
|
+
* @see {@link andThen} If you need to merge the outputs of both schedules.
|
|
211
356
|
*
|
|
212
357
|
* @since 2.0.0
|
|
213
|
-
* @category
|
|
358
|
+
* @category Sequential Composition
|
|
214
359
|
*/
|
|
215
360
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Either.Either<Out2, Out>, In & In2, R2 | R>;
|
|
216
361
|
/**
|
|
217
|
-
*
|
|
218
|
-
*
|
|
362
|
+
* Runs two schedules sequentially, collecting results in an `Either`.
|
|
363
|
+
*
|
|
364
|
+
* **Details**
|
|
365
|
+
*
|
|
366
|
+
* This function combines two schedules in sequence. The first schedule runs to
|
|
367
|
+
* completion, and then the second schedule starts and runs to completion as
|
|
368
|
+
* well. The outputs of both schedules are collected into an `Either` structure:
|
|
369
|
+
* - `Either.Left` contains the output of the second schedule.
|
|
370
|
+
* - `Either.Right` contains the output of the first schedule.
|
|
371
|
+
*
|
|
372
|
+
* This is useful when you need to switch from one schedule to another after the
|
|
373
|
+
* first one finishes, while still keeping track of which schedule produced each
|
|
374
|
+
* result.
|
|
375
|
+
*
|
|
376
|
+
* @see {@link andThen} If you need to merge the outputs of both schedules.
|
|
219
377
|
*
|
|
220
378
|
* @since 2.0.0
|
|
221
|
-
* @category
|
|
379
|
+
* @category Sequential Composition
|
|
222
380
|
*/
|
|
223
381
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<Either.Either<Out2, Out>, In & In2, R | R2>;
|
|
224
382
|
};
|
|
225
383
|
/**
|
|
226
|
-
*
|
|
384
|
+
* Transforms a schedule to always produce a constant output.
|
|
385
|
+
*
|
|
386
|
+
* **Details**
|
|
387
|
+
*
|
|
388
|
+
* This function modifies a given schedule so that instead of returning its
|
|
389
|
+
* computed outputs, it always returns a constant value.
|
|
390
|
+
*
|
|
391
|
+
* This is useful when you need a schedule for timing but don’t care about its
|
|
392
|
+
* actual output, or when you want to standardize results across different
|
|
393
|
+
* scheduling strategies.
|
|
227
394
|
*
|
|
228
395
|
* @since 2.0.0
|
|
229
|
-
* @category
|
|
396
|
+
* @category Mapping
|
|
230
397
|
*/
|
|
231
398
|
export declare const as: {
|
|
232
399
|
/**
|
|
233
|
-
*
|
|
400
|
+
* Transforms a schedule to always produce a constant output.
|
|
401
|
+
*
|
|
402
|
+
* **Details**
|
|
403
|
+
*
|
|
404
|
+
* This function modifies a given schedule so that instead of returning its
|
|
405
|
+
* computed outputs, it always returns a constant value.
|
|
406
|
+
*
|
|
407
|
+
* This is useful when you need a schedule for timing but don’t care about its
|
|
408
|
+
* actual output, or when you want to standardize results across different
|
|
409
|
+
* scheduling strategies.
|
|
234
410
|
*
|
|
235
411
|
* @since 2.0.0
|
|
236
|
-
* @category
|
|
412
|
+
* @category Mapping
|
|
237
413
|
*/
|
|
238
414
|
<Out2>(out: Out2): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out2, In, R>;
|
|
239
415
|
/**
|
|
240
|
-
*
|
|
416
|
+
* Transforms a schedule to always produce a constant output.
|
|
417
|
+
*
|
|
418
|
+
* **Details**
|
|
419
|
+
*
|
|
420
|
+
* This function modifies a given schedule so that instead of returning its
|
|
421
|
+
* computed outputs, it always returns a constant value.
|
|
422
|
+
*
|
|
423
|
+
* This is useful when you need a schedule for timing but don’t care about its
|
|
424
|
+
* actual output, or when you want to standardize results across different
|
|
425
|
+
* scheduling strategies.
|
|
241
426
|
*
|
|
242
427
|
* @since 2.0.0
|
|
243
|
-
* @category
|
|
428
|
+
* @category Mapping
|
|
244
429
|
*/
|
|
245
430
|
<Out, In, R, Out2>(self: Schedule<Out, In, R>, out: Out2): Schedule<Out2, In, R>;
|
|
246
431
|
};
|
|
247
432
|
/**
|
|
248
|
-
*
|
|
433
|
+
* Transforms a schedule to always return `void` instead of its output.
|
|
434
|
+
*
|
|
435
|
+
* **Details**
|
|
436
|
+
*
|
|
437
|
+
* This function modifies a given schedule so that it no longer returns
|
|
438
|
+
* meaningful output—each execution produces `void`. This is useful when the
|
|
439
|
+
* schedule is used only for timing purposes and the actual output of the
|
|
440
|
+
* schedule is irrelevant.
|
|
441
|
+
*
|
|
442
|
+
* The schedule still determines when executions should occur, but the results
|
|
443
|
+
* are discarded.
|
|
249
444
|
*
|
|
250
445
|
* @since 2.0.0
|
|
251
|
-
* @category
|
|
446
|
+
* @category Mapping
|
|
252
447
|
*/
|
|
253
448
|
export declare const asVoid: <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<void, In, R>;
|
|
254
449
|
/**
|
|
255
|
-
*
|
|
256
|
-
*
|
|
450
|
+
* Combines two schedules, preserving both their inputs and outputs.
|
|
451
|
+
*
|
|
452
|
+
* **Details**
|
|
453
|
+
*
|
|
454
|
+
* This function merges two schedules so that both their input types and output
|
|
455
|
+
* types are retained. When executed, the resulting schedule will take inputs
|
|
456
|
+
* from both original schedules and produce a tuple containing both outputs.
|
|
457
|
+
*
|
|
458
|
+
* It recurs if either schedule wants to continue, using the shorter delay.
|
|
459
|
+
*
|
|
460
|
+
* This is useful when you want to track multiple schedules simultaneously,
|
|
461
|
+
* ensuring that both receive the same inputs and produce combined results.
|
|
257
462
|
*
|
|
258
463
|
* @since 2.0.0
|
|
259
|
-
* @category
|
|
464
|
+
* @category Zipping
|
|
260
465
|
*/
|
|
261
466
|
export declare const bothInOut: {
|
|
262
467
|
/**
|
|
263
|
-
*
|
|
264
|
-
*
|
|
468
|
+
* Combines two schedules, preserving both their inputs and outputs.
|
|
469
|
+
*
|
|
470
|
+
* **Details**
|
|
471
|
+
*
|
|
472
|
+
* This function merges two schedules so that both their input types and output
|
|
473
|
+
* types are retained. When executed, the resulting schedule will take inputs
|
|
474
|
+
* from both original schedules and produce a tuple containing both outputs.
|
|
475
|
+
*
|
|
476
|
+
* It recurs if either schedule wants to continue, using the shorter delay.
|
|
477
|
+
*
|
|
478
|
+
* This is useful when you want to track multiple schedules simultaneously,
|
|
479
|
+
* ensuring that both receive the same inputs and produce combined results.
|
|
265
480
|
*
|
|
266
481
|
* @since 2.0.0
|
|
267
|
-
* @category
|
|
482
|
+
* @category Zipping
|
|
268
483
|
*/
|
|
269
484
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<[Out, Out2], readonly [In, In2], R2 | R>;
|
|
270
485
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
486
|
+
* Combines two schedules, preserving both their inputs and outputs.
|
|
487
|
+
*
|
|
488
|
+
* **Details**
|
|
489
|
+
*
|
|
490
|
+
* This function merges two schedules so that both their input types and output
|
|
491
|
+
* types are retained. When executed, the resulting schedule will take inputs
|
|
492
|
+
* from both original schedules and produce a tuple containing both outputs.
|
|
493
|
+
*
|
|
494
|
+
* It recurs if either schedule wants to continue, using the shorter delay.
|
|
495
|
+
*
|
|
496
|
+
* This is useful when you want to track multiple schedules simultaneously,
|
|
497
|
+
* ensuring that both receive the same inputs and produce combined results.
|
|
273
498
|
*
|
|
274
499
|
* @since 2.0.0
|
|
275
|
-
* @category
|
|
500
|
+
* @category Zipping
|
|
276
501
|
*/
|
|
277
502
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<[Out, Out2], readonly [In, In2], R | R2>;
|
|
278
503
|
};
|
|
279
504
|
/**
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
505
|
+
* Filters schedule executions based on a custom condition.
|
|
506
|
+
*
|
|
507
|
+
* **Details**
|
|
508
|
+
*
|
|
509
|
+
* This function modifies a schedule by applying a custom test function to each
|
|
510
|
+
* input-output pair. The test function determines whether the schedule should
|
|
511
|
+
* continue or stop. If the function returns `true`, the schedule proceeds as
|
|
512
|
+
* usual; if it returns `false`, the schedule terminates.
|
|
513
|
+
*
|
|
514
|
+
* This is useful for conditional retries, custom stop conditions, or
|
|
515
|
+
* dynamically controlling execution based on observed inputs and outputs.
|
|
516
|
+
*
|
|
517
|
+
* @see {@link checkEffect} If you need to use an effectful test function.
|
|
283
518
|
*
|
|
284
519
|
* @since 2.0.0
|
|
285
|
-
* @category
|
|
520
|
+
* @category Recurrence Conditions
|
|
286
521
|
*/
|
|
287
522
|
export declare const check: {
|
|
288
523
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
524
|
+
* Filters schedule executions based on a custom condition.
|
|
525
|
+
*
|
|
526
|
+
* **Details**
|
|
527
|
+
*
|
|
528
|
+
* This function modifies a schedule by applying a custom test function to each
|
|
529
|
+
* input-output pair. The test function determines whether the schedule should
|
|
530
|
+
* continue or stop. If the function returns `true`, the schedule proceeds as
|
|
531
|
+
* usual; if it returns `false`, the schedule terminates.
|
|
532
|
+
*
|
|
533
|
+
* This is useful for conditional retries, custom stop conditions, or
|
|
534
|
+
* dynamically controlling execution based on observed inputs and outputs.
|
|
535
|
+
*
|
|
536
|
+
* @see {@link checkEffect} If you need to use an effectful test function.
|
|
292
537
|
*
|
|
293
538
|
* @since 2.0.0
|
|
294
|
-
* @category
|
|
539
|
+
* @category Recurrence Conditions
|
|
295
540
|
*/
|
|
296
541
|
<In, Out>(test: (input: In, output: Out) => boolean): <R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
297
542
|
/**
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
543
|
+
* Filters schedule executions based on a custom condition.
|
|
544
|
+
*
|
|
545
|
+
* **Details**
|
|
546
|
+
*
|
|
547
|
+
* This function modifies a schedule by applying a custom test function to each
|
|
548
|
+
* input-output pair. The test function determines whether the schedule should
|
|
549
|
+
* continue or stop. If the function returns `true`, the schedule proceeds as
|
|
550
|
+
* usual; if it returns `false`, the schedule terminates.
|
|
551
|
+
*
|
|
552
|
+
* This is useful for conditional retries, custom stop conditions, or
|
|
553
|
+
* dynamically controlling execution based on observed inputs and outputs.
|
|
554
|
+
*
|
|
555
|
+
* @see {@link checkEffect} If you need to use an effectful test function.
|
|
301
556
|
*
|
|
302
557
|
* @since 2.0.0
|
|
303
|
-
* @category
|
|
558
|
+
* @category Recurrence Conditions
|
|
304
559
|
*/
|
|
305
560
|
<Out, In, R>(self: Schedule<Out, In, R>, test: (input: In, output: Out) => boolean): Schedule<Out, In, R>;
|
|
306
561
|
};
|
|
307
562
|
/**
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
563
|
+
* Conditionally filters schedule executions using an effectful function.
|
|
564
|
+
*
|
|
565
|
+
* **Details**
|
|
566
|
+
*
|
|
567
|
+
* This function modifies a schedule by applying a custom effectful test
|
|
568
|
+
* function to each input-output pair. The test function determines whether the
|
|
569
|
+
* schedule should continue (`true`) or stop (`false`).
|
|
570
|
+
*
|
|
571
|
+
* This is useful when the decision to continue depends on external factors such
|
|
572
|
+
* as database lookups, API calls, or other asynchronous computations.
|
|
573
|
+
*
|
|
574
|
+
* @see {@link check} If you need to use a pure test function.
|
|
311
575
|
*
|
|
312
576
|
* @since 2.0.0
|
|
313
|
-
* @category
|
|
577
|
+
* @category Recurrence Conditions
|
|
314
578
|
*/
|
|
315
579
|
export declare const checkEffect: {
|
|
316
580
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
581
|
+
* Conditionally filters schedule executions using an effectful function.
|
|
582
|
+
*
|
|
583
|
+
* **Details**
|
|
584
|
+
*
|
|
585
|
+
* This function modifies a schedule by applying a custom effectful test
|
|
586
|
+
* function to each input-output pair. The test function determines whether the
|
|
587
|
+
* schedule should continue (`true`) or stop (`false`).
|
|
588
|
+
*
|
|
589
|
+
* This is useful when the decision to continue depends on external factors such
|
|
590
|
+
* as database lookups, API calls, or other asynchronous computations.
|
|
591
|
+
*
|
|
592
|
+
* @see {@link check} If you need to use a pure test function.
|
|
320
593
|
*
|
|
321
594
|
* @since 2.0.0
|
|
322
|
-
* @category
|
|
595
|
+
* @category Recurrence Conditions
|
|
323
596
|
*/
|
|
324
597
|
<In, Out, R2>(test: (input: In, output: Out) => Effect.Effect<boolean, never, R2>): <R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
325
598
|
/**
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
599
|
+
* Conditionally filters schedule executions using an effectful function.
|
|
600
|
+
*
|
|
601
|
+
* **Details**
|
|
602
|
+
*
|
|
603
|
+
* This function modifies a schedule by applying a custom effectful test
|
|
604
|
+
* function to each input-output pair. The test function determines whether the
|
|
605
|
+
* schedule should continue (`true`) or stop (`false`).
|
|
606
|
+
*
|
|
607
|
+
* This is useful when the decision to continue depends on external factors such
|
|
608
|
+
* as database lookups, API calls, or other asynchronous computations.
|
|
609
|
+
*
|
|
610
|
+
* @see {@link check} If you need to use a pure test function.
|
|
329
611
|
*
|
|
330
612
|
* @since 2.0.0
|
|
331
|
-
* @category
|
|
613
|
+
* @category Recurrence Conditions
|
|
332
614
|
*/
|
|
333
615
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, test: (input: In, output: Out) => Effect.Effect<boolean, never, R2>): Schedule<Out, In, R | R2>;
|
|
334
616
|
};
|
|
335
617
|
/**
|
|
336
|
-
* A schedule that
|
|
618
|
+
* A schedule that collects all inputs into a `Chunk`.
|
|
619
|
+
*
|
|
620
|
+
* **Details**
|
|
621
|
+
*
|
|
622
|
+
* This function creates a schedule that never terminates and continuously
|
|
623
|
+
* collects every input it receives into a `Chunk`. Each time the schedule runs,
|
|
624
|
+
* it appends the new input to the collected list.
|
|
625
|
+
*
|
|
626
|
+
* This is useful when you need to track all received inputs over time, such as
|
|
627
|
+
* logging user actions, recording retry attempts, or accumulating data for
|
|
628
|
+
* later processing.
|
|
629
|
+
*
|
|
630
|
+
* @see {@link collectAllOutputs} If you need to collect outputs instead of
|
|
631
|
+
* inputs.
|
|
337
632
|
*
|
|
338
633
|
* @since 2.0.0
|
|
339
|
-
* @category
|
|
634
|
+
* @category Collecting
|
|
340
635
|
*/
|
|
341
636
|
export declare const collectAllInputs: <A>() => Schedule<Chunk.Chunk<A>, A>;
|
|
342
637
|
/**
|
|
343
|
-
*
|
|
638
|
+
* Collects all outputs of a schedule into a `Chunk`.
|
|
639
|
+
*
|
|
640
|
+
* **Details**
|
|
641
|
+
*
|
|
642
|
+
* This function modifies a given schedule so that instead of returning
|
|
643
|
+
* individual outputs, it accumulates them into a `Chunk`. The schedule
|
|
644
|
+
* continues to run, appending each output to the collected list.
|
|
645
|
+
*
|
|
646
|
+
* This is useful when you need to track all results over time, such as logging
|
|
647
|
+
* outputs, aggregating data, or keeping a history of previous values.
|
|
648
|
+
*
|
|
649
|
+
* @see {@link collectAllInputs} If you need to collect inputs instead of
|
|
650
|
+
* outputs.
|
|
344
651
|
*
|
|
345
652
|
* @since 2.0.0
|
|
346
|
-
* @category
|
|
653
|
+
* @category Collecting
|
|
347
654
|
*/
|
|
348
655
|
export declare const collectAllOutputs: <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Chunk.Chunk<Out>, In, R>;
|
|
349
656
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
657
|
+
* Collects all inputs into a `Chunk` until a condition fails.
|
|
658
|
+
*
|
|
659
|
+
* **Details**
|
|
660
|
+
*
|
|
661
|
+
* This function creates a schedule that continuously collects inputs into a
|
|
662
|
+
* `Chunk` until the given predicate function `f` evaluates to `false`. Once the
|
|
663
|
+
* condition fails, the schedule stops.
|
|
352
664
|
*
|
|
353
665
|
* @since 2.0.0
|
|
354
|
-
* @category
|
|
666
|
+
* @category Collecting
|
|
355
667
|
*/
|
|
356
668
|
export declare const collectUntil: <A>(f: Predicate<A>) => Schedule<Chunk.Chunk<A>, A>;
|
|
357
669
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
670
|
+
* Collects all inputs into a `Chunk` until an effectful condition fails.
|
|
671
|
+
*
|
|
672
|
+
* **Details**
|
|
673
|
+
*
|
|
674
|
+
* This function creates a schedule that continuously collects inputs into a
|
|
675
|
+
* `Chunk` until the given effectful predicate `f` returns `false`. The
|
|
676
|
+
* predicate runs as an effect, meaning it can involve asynchronous computations
|
|
677
|
+
* like API calls, database lookups, or randomness.
|
|
360
678
|
*
|
|
361
679
|
* @since 2.0.0
|
|
362
|
-
* @category
|
|
680
|
+
* @category Collecting
|
|
363
681
|
*/
|
|
364
682
|
export declare const collectUntilEffect: <A, R>(f: (a: A) => Effect.Effect<boolean, never, R>) => Schedule<Chunk.Chunk<A>, A, R>;
|
|
365
683
|
/**
|
|
366
|
-
*
|
|
367
|
-
*
|
|
684
|
+
* Collects all inputs into a `Chunk` while a condition holds.
|
|
685
|
+
*
|
|
686
|
+
* **Details**
|
|
687
|
+
*
|
|
688
|
+
* This function creates a schedule that continuously collects inputs into a
|
|
689
|
+
* `Chunk` while the given predicate function `f` evaluates to `true`. As soon
|
|
690
|
+
* as the condition fails, the schedule stops.
|
|
368
691
|
*
|
|
369
692
|
* @since 2.0.0
|
|
370
|
-
* @category
|
|
693
|
+
* @category Collecting
|
|
371
694
|
*/
|
|
372
695
|
export declare const collectWhile: <A>(f: Predicate<A>) => Schedule<Chunk.Chunk<A>, A>;
|
|
373
696
|
/**
|
|
374
|
-
*
|
|
375
|
-
*
|
|
697
|
+
* Collects all inputs into a `Chunk` while an effectful condition holds.
|
|
698
|
+
*
|
|
699
|
+
* **Details**
|
|
700
|
+
*
|
|
701
|
+
* This function creates a schedule that continuously collects inputs into a
|
|
702
|
+
* `Chunk` while the given effectful predicate `f` returns `true`. The predicate
|
|
703
|
+
* returns an effect, meaning it can depend on external state, such as database
|
|
704
|
+
* queries, API responses, or real-time user conditions.
|
|
705
|
+
*
|
|
706
|
+
* As soon as the effectful condition returns `false`, the schedule stops. This
|
|
707
|
+
* is useful for dynamically controlled data collection, where stopping depends
|
|
708
|
+
* on an external or asynchronous factor.
|
|
376
709
|
*
|
|
377
|
-
* @category utils
|
|
378
710
|
* @since 2.0.0
|
|
711
|
+
* @category Collecting
|
|
379
712
|
*/
|
|
380
713
|
export declare const collectWhileEffect: <A, R>(f: (a: A) => Effect.Effect<boolean, never, R>) => Schedule<Chunk.Chunk<A>, A, R>;
|
|
381
714
|
/**
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
715
|
+
* Chains two schedules, passing the output of the first as the input to the
|
|
716
|
+
* second, while selecting the shorter delay between them.
|
|
717
|
+
*
|
|
718
|
+
* **Details**
|
|
719
|
+
*
|
|
720
|
+
* This function composes two schedules so that the output of the first schedule
|
|
721
|
+
* becomes the input of the second schedule. The first schedule executes first,
|
|
722
|
+
* and once it produces a result, the second schedule receives that result and
|
|
723
|
+
* continues execution based on it.
|
|
724
|
+
*
|
|
725
|
+
* This is useful for building complex scheduling workflows where one schedule's
|
|
726
|
+
* behavior determines how the next schedule behaves.
|
|
386
727
|
*
|
|
387
728
|
* @since 2.0.0
|
|
388
|
-
* @category
|
|
729
|
+
* @category Composition
|
|
389
730
|
*/
|
|
390
731
|
export declare const compose: {
|
|
391
732
|
/**
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
733
|
+
* Chains two schedules, passing the output of the first as the input to the
|
|
734
|
+
* second, while selecting the shorter delay between them.
|
|
735
|
+
*
|
|
736
|
+
* **Details**
|
|
737
|
+
*
|
|
738
|
+
* This function composes two schedules so that the output of the first schedule
|
|
739
|
+
* becomes the input of the second schedule. The first schedule executes first,
|
|
740
|
+
* and once it produces a result, the second schedule receives that result and
|
|
741
|
+
* continues execution based on it.
|
|
742
|
+
*
|
|
743
|
+
* This is useful for building complex scheduling workflows where one schedule's
|
|
744
|
+
* behavior determines how the next schedule behaves.
|
|
396
745
|
*
|
|
397
746
|
* @since 2.0.0
|
|
398
|
-
* @category
|
|
747
|
+
* @category Composition
|
|
399
748
|
*/
|
|
400
749
|
<Out2, Out, R2>(that: Schedule<Out2, Out, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out2, In, R2 | R>;
|
|
401
750
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
751
|
+
* Chains two schedules, passing the output of the first as the input to the
|
|
752
|
+
* second, while selecting the shorter delay between them.
|
|
753
|
+
*
|
|
754
|
+
* **Details**
|
|
755
|
+
*
|
|
756
|
+
* This function composes two schedules so that the output of the first schedule
|
|
757
|
+
* becomes the input of the second schedule. The first schedule executes first,
|
|
758
|
+
* and once it produces a result, the second schedule receives that result and
|
|
759
|
+
* continues execution based on it.
|
|
760
|
+
*
|
|
761
|
+
* This is useful for building complex scheduling workflows where one schedule's
|
|
762
|
+
* behavior determines how the next schedule behaves.
|
|
406
763
|
*
|
|
407
764
|
* @since 2.0.0
|
|
408
|
-
* @category
|
|
765
|
+
* @category Composition
|
|
409
766
|
*/
|
|
410
767
|
<Out, In, R, Out2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, Out, R2>): Schedule<Out2, In, R | R2>;
|
|
411
768
|
};
|
|
412
769
|
/**
|
|
413
|
-
*
|
|
414
|
-
*
|
|
770
|
+
* Transforms the input type of a schedule.
|
|
771
|
+
*
|
|
772
|
+
* **Details**
|
|
773
|
+
*
|
|
774
|
+
* This function modifies a given schedule by applying a transformation function
|
|
775
|
+
* to its inputs. Instead of directly receiving values of type `In`, the
|
|
776
|
+
* schedule will now accept values of type `In2`, which are converted to `In`
|
|
777
|
+
* using the provided mapping function `f`.
|
|
778
|
+
*
|
|
779
|
+
* This is useful when you have a schedule that expects a specific input type
|
|
780
|
+
* but you need to adapt it to work with a different type.
|
|
781
|
+
*
|
|
782
|
+
* @see {@link mapInputEffect} If you need to use an effectful transformation function.
|
|
415
783
|
*
|
|
416
784
|
* @since 2.0.0
|
|
417
|
-
* @category
|
|
785
|
+
* @category Mapping
|
|
418
786
|
*/
|
|
419
787
|
export declare const mapInput: {
|
|
420
788
|
/**
|
|
421
|
-
*
|
|
422
|
-
*
|
|
789
|
+
* Transforms the input type of a schedule.
|
|
790
|
+
*
|
|
791
|
+
* **Details**
|
|
792
|
+
*
|
|
793
|
+
* This function modifies a given schedule by applying a transformation function
|
|
794
|
+
* to its inputs. Instead of directly receiving values of type `In`, the
|
|
795
|
+
* schedule will now accept values of type `In2`, which are converted to `In`
|
|
796
|
+
* using the provided mapping function `f`.
|
|
797
|
+
*
|
|
798
|
+
* This is useful when you have a schedule that expects a specific input type
|
|
799
|
+
* but you need to adapt it to work with a different type.
|
|
800
|
+
*
|
|
801
|
+
* @see {@link mapInputEffect} If you need to use an effectful transformation function.
|
|
423
802
|
*
|
|
424
803
|
* @since 2.0.0
|
|
425
|
-
* @category
|
|
804
|
+
* @category Mapping
|
|
426
805
|
*/
|
|
427
806
|
<In, In2>(f: (in2: In2) => In): <Out, R>(self: Schedule<Out, In, R>) => Schedule<Out, In2, R>;
|
|
428
807
|
/**
|
|
429
|
-
*
|
|
430
|
-
*
|
|
808
|
+
* Transforms the input type of a schedule.
|
|
809
|
+
*
|
|
810
|
+
* **Details**
|
|
811
|
+
*
|
|
812
|
+
* This function modifies a given schedule by applying a transformation function
|
|
813
|
+
* to its inputs. Instead of directly receiving values of type `In`, the
|
|
814
|
+
* schedule will now accept values of type `In2`, which are converted to `In`
|
|
815
|
+
* using the provided mapping function `f`.
|
|
816
|
+
*
|
|
817
|
+
* This is useful when you have a schedule that expects a specific input type
|
|
818
|
+
* but you need to adapt it to work with a different type.
|
|
819
|
+
*
|
|
820
|
+
* @see {@link mapInputEffect} If you need to use an effectful transformation function.
|
|
431
821
|
*
|
|
432
822
|
* @since 2.0.0
|
|
433
|
-
* @category
|
|
823
|
+
* @category Mapping
|
|
434
824
|
*/
|
|
435
825
|
<Out, In, R, In2>(self: Schedule<Out, In, R>, f: (in2: In2) => In): Schedule<Out, In2, R>;
|
|
436
826
|
};
|
|
437
827
|
/**
|
|
438
|
-
* Transforms the
|
|
439
|
-
*
|
|
828
|
+
* Transforms the input type of a schedule using an effectful function.
|
|
829
|
+
*
|
|
830
|
+
* **Details**
|
|
831
|
+
*
|
|
832
|
+
* This function modifies a schedule by applying an effectful transformation to
|
|
833
|
+
* its inputs. Instead of directly receiving values of type `In`, the schedule
|
|
834
|
+
* will now accept values of type `In2`, which are converted to `In` via an
|
|
835
|
+
* effectful function `f`.
|
|
836
|
+
*
|
|
837
|
+
* This is useful when the input transformation involves external dependencies,
|
|
838
|
+
* such as API calls, database lookups, or other asynchronous computations.
|
|
839
|
+
*
|
|
840
|
+
* @see {@link mapInput} If you need to use a pure transformation function.
|
|
440
841
|
*
|
|
441
842
|
* @since 2.0.0
|
|
442
|
-
* @category
|
|
843
|
+
* @category Mapping
|
|
443
844
|
*/
|
|
444
|
-
export declare const
|
|
845
|
+
export declare const mapInputEffect: {
|
|
445
846
|
/**
|
|
446
|
-
* Transforms the
|
|
447
|
-
*
|
|
847
|
+
* Transforms the input type of a schedule using an effectful function.
|
|
848
|
+
*
|
|
849
|
+
* **Details**
|
|
850
|
+
*
|
|
851
|
+
* This function modifies a schedule by applying an effectful transformation to
|
|
852
|
+
* its inputs. Instead of directly receiving values of type `In`, the schedule
|
|
853
|
+
* will now accept values of type `In2`, which are converted to `In` via an
|
|
854
|
+
* effectful function `f`.
|
|
855
|
+
*
|
|
856
|
+
* This is useful when the input transformation involves external dependencies,
|
|
857
|
+
* such as API calls, database lookups, or other asynchronous computations.
|
|
858
|
+
*
|
|
859
|
+
* @see {@link mapInput} If you need to use a pure transformation function.
|
|
448
860
|
*
|
|
449
861
|
* @since 2.0.0
|
|
450
|
-
* @category
|
|
862
|
+
* @category Mapping
|
|
451
863
|
*/
|
|
452
|
-
<
|
|
864
|
+
<In2, In, R2>(f: (in2: In2) => Effect.Effect<In, never, R2>): <Out, R>(self: Schedule<Out, In, R>) => Schedule<Out, In2, R2 | R>;
|
|
453
865
|
/**
|
|
454
|
-
* Transforms the
|
|
455
|
-
*
|
|
866
|
+
* Transforms the input type of a schedule using an effectful function.
|
|
867
|
+
*
|
|
868
|
+
* **Details**
|
|
869
|
+
*
|
|
870
|
+
* This function modifies a schedule by applying an effectful transformation to
|
|
871
|
+
* its inputs. Instead of directly receiving values of type `In`, the schedule
|
|
872
|
+
* will now accept values of type `In2`, which are converted to `In` via an
|
|
873
|
+
* effectful function `f`.
|
|
874
|
+
*
|
|
875
|
+
* This is useful when the input transformation involves external dependencies,
|
|
876
|
+
* such as API calls, database lookups, or other asynchronous computations.
|
|
877
|
+
*
|
|
878
|
+
* @see {@link mapInput} If you need to use a pure transformation function.
|
|
456
879
|
*
|
|
457
880
|
* @since 2.0.0
|
|
458
|
-
* @category
|
|
881
|
+
* @category Mapping
|
|
459
882
|
*/
|
|
460
|
-
<Out, In, R,
|
|
883
|
+
<Out, In, R, In2, R2>(self: Schedule<Out, In, R>, f: (in2: In2) => Effect.Effect<In, never, R2>): Schedule<Out, In2, R | R2>;
|
|
461
884
|
};
|
|
462
885
|
/**
|
|
463
|
-
*
|
|
464
|
-
*
|
|
886
|
+
* Transforms the required context of a schedule.
|
|
887
|
+
*
|
|
888
|
+
* **Details**
|
|
889
|
+
*
|
|
890
|
+
* This function modifies a schedule by mapping its required context (`R`) into
|
|
891
|
+
* a new context (`R0`) using the provided function `f`.
|
|
892
|
+
*
|
|
893
|
+
* This is useful when you need to adapt a schedule to work with a different
|
|
894
|
+
* dependency environment without changing its core logic.
|
|
465
895
|
*
|
|
466
896
|
* @since 2.0.0
|
|
467
|
-
* @category
|
|
897
|
+
* @category Mapping
|
|
468
898
|
*/
|
|
469
|
-
export declare const
|
|
899
|
+
export declare const mapInputContext: {
|
|
470
900
|
/**
|
|
471
|
-
*
|
|
472
|
-
*
|
|
901
|
+
* Transforms the required context of a schedule.
|
|
902
|
+
*
|
|
903
|
+
* **Details**
|
|
904
|
+
*
|
|
905
|
+
* This function modifies a schedule by mapping its required context (`R`) into
|
|
906
|
+
* a new context (`R0`) using the provided function `f`.
|
|
907
|
+
*
|
|
908
|
+
* This is useful when you need to adapt a schedule to work with a different
|
|
909
|
+
* dependency environment without changing its core logic.
|
|
473
910
|
*
|
|
474
911
|
* @since 2.0.0
|
|
475
|
-
* @category
|
|
912
|
+
* @category Mapping
|
|
476
913
|
*/
|
|
477
|
-
<
|
|
914
|
+
<R0, R>(f: (env0: Context.Context<R0>) => Context.Context<R>): <Out, In>(self: Schedule<Out, In, R>) => Schedule<Out, In, R0>;
|
|
478
915
|
/**
|
|
479
|
-
*
|
|
480
|
-
*
|
|
916
|
+
* Transforms the required context of a schedule.
|
|
917
|
+
*
|
|
918
|
+
* **Details**
|
|
919
|
+
*
|
|
920
|
+
* This function modifies a schedule by mapping its required context (`R`) into
|
|
921
|
+
* a new context (`R0`) using the provided function `f`.
|
|
922
|
+
*
|
|
923
|
+
* This is useful when you need to adapt a schedule to work with a different
|
|
924
|
+
* dependency environment without changing its core logic.
|
|
481
925
|
*
|
|
482
926
|
* @since 2.0.0
|
|
483
|
-
* @category
|
|
927
|
+
* @category Mapping
|
|
484
928
|
*/
|
|
485
|
-
<Out, In, R,
|
|
929
|
+
<Out, In, R, R0>(self: Schedule<Out, In, R>, f: (env0: Context.Context<R0>) => Context.Context<R>): Schedule<Out, In, R0>;
|
|
486
930
|
};
|
|
487
931
|
/**
|
|
488
|
-
* A schedule that
|
|
932
|
+
* A schedule that recurs indefinitely, counting the number of recurrences.
|
|
933
|
+
*
|
|
934
|
+
* **Details**
|
|
935
|
+
*
|
|
936
|
+
* This schedule never stops and simply counts how many times it has executed.
|
|
937
|
+
* Each recurrence increases the count, starting from `0`.
|
|
938
|
+
*
|
|
939
|
+
* This is useful when tracking the number of attempts in retry policies,
|
|
940
|
+
* measuring execution loops, or implementing infinite polling scenarios.
|
|
489
941
|
*
|
|
490
942
|
* @since 2.0.0
|
|
491
|
-
* @category
|
|
943
|
+
* @category Constructors
|
|
492
944
|
*/
|
|
493
945
|
export declare const count: Schedule<number>;
|
|
494
946
|
/**
|
|
495
|
-
*
|
|
947
|
+
* Creates a schedule that recurs based on a cron expression.
|
|
948
|
+
*
|
|
949
|
+
* **Details**
|
|
496
950
|
*
|
|
497
|
-
*
|
|
951
|
+
* This schedule automatically executes at intervals defined by a cron
|
|
952
|
+
* expression. It triggers at the beginning of each matched interval and
|
|
953
|
+
* produces timestamps representing the start and end of the cron window.
|
|
498
954
|
*
|
|
499
|
-
*
|
|
955
|
+
* The cron `expression` is validated lazily, meaning errors may only be
|
|
956
|
+
* detected when the schedule is executed.
|
|
500
957
|
*
|
|
501
958
|
* @since 2.0.0
|
|
502
|
-
* @category
|
|
959
|
+
* @category Cron
|
|
503
960
|
*/
|
|
504
961
|
export declare const cron: {
|
|
505
962
|
/**
|
|
506
|
-
*
|
|
963
|
+
* Creates a schedule that recurs based on a cron expression.
|
|
507
964
|
*
|
|
508
|
-
*
|
|
965
|
+
* **Details**
|
|
509
966
|
*
|
|
510
|
-
*
|
|
967
|
+
* This schedule automatically executes at intervals defined by a cron
|
|
968
|
+
* expression. It triggers at the beginning of each matched interval and
|
|
969
|
+
* produces timestamps representing the start and end of the cron window.
|
|
970
|
+
*
|
|
971
|
+
* The cron `expression` is validated lazily, meaning errors may only be
|
|
972
|
+
* detected when the schedule is executed.
|
|
511
973
|
*
|
|
512
974
|
* @since 2.0.0
|
|
513
|
-
* @category
|
|
975
|
+
* @category Cron
|
|
514
976
|
*/
|
|
515
977
|
(cron: Cron.Cron): Schedule<[number, number]>;
|
|
516
978
|
/**
|
|
517
|
-
*
|
|
979
|
+
* Creates a schedule that recurs based on a cron expression.
|
|
980
|
+
*
|
|
981
|
+
* **Details**
|
|
518
982
|
*
|
|
519
|
-
*
|
|
983
|
+
* This schedule automatically executes at intervals defined by a cron
|
|
984
|
+
* expression. It triggers at the beginning of each matched interval and
|
|
985
|
+
* produces timestamps representing the start and end of the cron window.
|
|
520
986
|
*
|
|
521
|
-
*
|
|
987
|
+
* The cron `expression` is validated lazily, meaning errors may only be
|
|
988
|
+
* detected when the schedule is executed.
|
|
522
989
|
*
|
|
523
990
|
* @since 2.0.0
|
|
524
|
-
* @category
|
|
991
|
+
* @category Cron
|
|
525
992
|
*/
|
|
526
993
|
(expression: string, tz?: DateTime.TimeZone | string): Schedule<[number, number]>;
|
|
527
994
|
};
|
|
528
995
|
/**
|
|
529
|
-
* Cron-like schedule that recurs
|
|
530
|
-
*
|
|
996
|
+
* Cron-like schedule that recurs at a specific second of each minute.
|
|
997
|
+
*
|
|
998
|
+
* **Details**
|
|
999
|
+
*
|
|
1000
|
+
* This schedule triggers at the specified `second` of each minute,
|
|
1001
|
+
* starting at zero nanoseconds. It produces a count of executions
|
|
1002
|
+
* (0, 1, 2, ...). The `second` parameter is validated lazily, meaning
|
|
1003
|
+
* invalid values will only be caught at runtime.
|
|
1004
|
+
*
|
|
1005
|
+
* @since 2.0.0
|
|
1006
|
+
* @category Cron
|
|
1007
|
+
*/
|
|
1008
|
+
export declare const secondOfMinute: (second: number) => Schedule<number>;
|
|
1009
|
+
/**
|
|
1010
|
+
* Creates a schedule that recurs every specified minute of each hour.
|
|
1011
|
+
*
|
|
1012
|
+
* **Details**
|
|
1013
|
+
*
|
|
1014
|
+
* This schedule triggers once per hour at the specified `minute`, starting
|
|
1015
|
+
* exactly at `minute:00` (zero seconds). The schedule produces a count of
|
|
1016
|
+
* executions (`0, 1, 2, ...`), representing how many times it has run.
|
|
1017
|
+
*
|
|
1018
|
+
* The `minute` parameter must be between `0` and `59`. It is validated lazily,
|
|
1019
|
+
* meaning an invalid value will cause errors only when the schedule is
|
|
1020
|
+
* executed.
|
|
1021
|
+
*
|
|
1022
|
+
* @since 2.0.0
|
|
1023
|
+
* @category Cron
|
|
1024
|
+
*/
|
|
1025
|
+
export declare const minuteOfHour: (minute: number) => Schedule<number>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Creates a schedule that recurs at a specific hour of each day.
|
|
1028
|
+
*
|
|
1029
|
+
* **Details**
|
|
1030
|
+
*
|
|
1031
|
+
* This schedule triggers once per day at the specified `hour`, starting at zero
|
|
1032
|
+
* minutes of that hour. The schedule produces a count of executions (`0, 1, 2,
|
|
1033
|
+
* ...`), indicating how many times it has been triggered.
|
|
1034
|
+
*
|
|
1035
|
+
* The `hour` parameter must be between `0` (midnight) and `23` (11 PM). It is
|
|
1036
|
+
* validated lazily, meaning an invalid value will cause errors only when the
|
|
1037
|
+
* schedule is executed.
|
|
1038
|
+
*
|
|
1039
|
+
* This is useful for scheduling daily recurring tasks at a fixed time, such as
|
|
1040
|
+
* running batch jobs or refreshing data.
|
|
1041
|
+
*
|
|
1042
|
+
* @since 2.0.0
|
|
1043
|
+
* @category Cron
|
|
1044
|
+
*/
|
|
1045
|
+
export declare const hourOfDay: (hour: number) => Schedule<number>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Creates a schedule that recurs on a specific day of the month.
|
|
1048
|
+
*
|
|
1049
|
+
* **Details**
|
|
1050
|
+
*
|
|
1051
|
+
* This schedule triggers at midnight on the specified day of each month. It
|
|
1052
|
+
* will not execute in months that have fewer days than the given day. For
|
|
1053
|
+
* example, if the schedule is set to run on the 31st, it will not execute in
|
|
1054
|
+
* months with only 30 days.
|
|
531
1055
|
*
|
|
532
|
-
*
|
|
1056
|
+
* The schedule produces a count of executions, starting at 0 and incrementing
|
|
1057
|
+
* with each recurrence.
|
|
533
1058
|
*
|
|
534
|
-
*
|
|
1059
|
+
* The `day` parameter is validated lazily, meaning errors may only be detected
|
|
1060
|
+
* when the schedule is executed.
|
|
535
1061
|
*
|
|
536
1062
|
* @since 2.0.0
|
|
537
|
-
* @category
|
|
1063
|
+
* @category Cron
|
|
538
1064
|
*/
|
|
539
1065
|
export declare const dayOfMonth: (day: number) => Schedule<number>;
|
|
540
1066
|
/**
|
|
541
|
-
*
|
|
542
|
-
* triggers at zero hour of the week. Producing a count of repeats: 0, 1, 2.
|
|
1067
|
+
* Creates a schedule that recurs on a specific day of the week.
|
|
543
1068
|
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
1069
|
+
* **Details**
|
|
1070
|
+
*
|
|
1071
|
+
* This schedule triggers at midnight on the specified day of the week. The
|
|
1072
|
+
* `day` parameter follows the standard convention where `Monday = 1` and
|
|
1073
|
+
* `Sunday = 7`. The schedule produces a count of executions, starting at 0 and
|
|
1074
|
+
* incrementing with each recurrence.
|
|
1075
|
+
*
|
|
1076
|
+
* The `day` parameter is validated lazily, meaning errors may only be detected
|
|
1077
|
+
* when the schedule is executed.
|
|
546
1078
|
*
|
|
547
1079
|
* @since 2.0.0
|
|
548
|
-
* @category
|
|
1080
|
+
* @category Cron
|
|
549
1081
|
*/
|
|
550
1082
|
export declare const dayOfWeek: (day: number) => Schedule<number>;
|
|
551
1083
|
/**
|
|
552
|
-
*
|
|
553
|
-
*
|
|
1084
|
+
* Modifies a schedule by adding a computed delay before each execution.
|
|
1085
|
+
*
|
|
1086
|
+
* **Details**
|
|
1087
|
+
*
|
|
1088
|
+
* This function adjusts an existing schedule by applying a transformation to
|
|
1089
|
+
* its delays. Instead of using the default interval, each delay is modified
|
|
1090
|
+
* using the provided function `f`, which takes the current delay and returns a
|
|
1091
|
+
* new delay.
|
|
1092
|
+
*
|
|
1093
|
+
* This is useful for dynamically adjusting wait times between executions, such
|
|
1094
|
+
* as introducing jitter, exponential backoff, or custom delay logic.
|
|
1095
|
+
*
|
|
1096
|
+
* @see {@link delayedEffect} If you need to compute the delay using an effectful function.
|
|
554
1097
|
*
|
|
555
1098
|
* @since 2.0.0
|
|
556
|
-
* @category
|
|
1099
|
+
* @category Timing & Delay
|
|
557
1100
|
*/
|
|
558
1101
|
export declare const delayed: {
|
|
559
1102
|
/**
|
|
560
|
-
*
|
|
561
|
-
*
|
|
1103
|
+
* Modifies a schedule by adding a computed delay before each execution.
|
|
1104
|
+
*
|
|
1105
|
+
* **Details**
|
|
1106
|
+
*
|
|
1107
|
+
* This function adjusts an existing schedule by applying a transformation to
|
|
1108
|
+
* its delays. Instead of using the default interval, each delay is modified
|
|
1109
|
+
* using the provided function `f`, which takes the current delay and returns a
|
|
1110
|
+
* new delay.
|
|
1111
|
+
*
|
|
1112
|
+
* This is useful for dynamically adjusting wait times between executions, such
|
|
1113
|
+
* as introducing jitter, exponential backoff, or custom delay logic.
|
|
1114
|
+
*
|
|
1115
|
+
* @see {@link delayedEffect} If you need to compute the delay using an effectful function.
|
|
562
1116
|
*
|
|
563
1117
|
* @since 2.0.0
|
|
564
|
-
* @category
|
|
1118
|
+
* @category Timing & Delay
|
|
565
1119
|
*/
|
|
566
1120
|
(f: (duration: Duration.Duration) => Duration.DurationInput): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
567
1121
|
/**
|
|
568
|
-
*
|
|
569
|
-
*
|
|
1122
|
+
* Modifies a schedule by adding a computed delay before each execution.
|
|
1123
|
+
*
|
|
1124
|
+
* **Details**
|
|
1125
|
+
*
|
|
1126
|
+
* This function adjusts an existing schedule by applying a transformation to
|
|
1127
|
+
* its delays. Instead of using the default interval, each delay is modified
|
|
1128
|
+
* using the provided function `f`, which takes the current delay and returns a
|
|
1129
|
+
* new delay.
|
|
1130
|
+
*
|
|
1131
|
+
* This is useful for dynamically adjusting wait times between executions, such
|
|
1132
|
+
* as introducing jitter, exponential backoff, or custom delay logic.
|
|
1133
|
+
*
|
|
1134
|
+
* @see {@link delayedEffect} If you need to compute the delay using an effectful function.
|
|
570
1135
|
*
|
|
571
1136
|
* @since 2.0.0
|
|
572
|
-
* @category
|
|
1137
|
+
* @category Timing & Delay
|
|
573
1138
|
*/
|
|
574
1139
|
<Out, In, R>(self: Schedule<Out, In, R>, f: (duration: Duration.Duration) => Duration.DurationInput): Schedule<Out, In, R>;
|
|
575
1140
|
};
|
|
576
1141
|
/**
|
|
577
|
-
*
|
|
578
|
-
*
|
|
1142
|
+
* Modifies a schedule by adding an effectfully computed delay before each
|
|
1143
|
+
* execution.
|
|
1144
|
+
*
|
|
1145
|
+
* **Details**
|
|
1146
|
+
*
|
|
1147
|
+
* This function adjusts an existing schedule by introducing a delay that is
|
|
1148
|
+
* computed via an effect. Instead of using a fixed delay, each interval is
|
|
1149
|
+
* dynamically adjusted based on an effectful function `f`, which takes the
|
|
1150
|
+
* current delay and returns a new delay wrapped in an `Effect`.
|
|
1151
|
+
*
|
|
1152
|
+
* This is useful for adaptive scheduling where delays depend on external
|
|
1153
|
+
* factors, such as API calls, database queries, or dynamic system conditions.
|
|
1154
|
+
*
|
|
1155
|
+
* @see {@link delayed} If you need to compute the delay using a pure function.
|
|
579
1156
|
*
|
|
580
1157
|
* @since 2.0.0
|
|
581
|
-
* @category
|
|
1158
|
+
* @category Timing & Delay
|
|
582
1159
|
*/
|
|
583
1160
|
export declare const delayedEffect: {
|
|
584
1161
|
/**
|
|
585
|
-
*
|
|
586
|
-
*
|
|
1162
|
+
* Modifies a schedule by adding an effectfully computed delay before each
|
|
1163
|
+
* execution.
|
|
1164
|
+
*
|
|
1165
|
+
* **Details**
|
|
1166
|
+
*
|
|
1167
|
+
* This function adjusts an existing schedule by introducing a delay that is
|
|
1168
|
+
* computed via an effect. Instead of using a fixed delay, each interval is
|
|
1169
|
+
* dynamically adjusted based on an effectful function `f`, which takes the
|
|
1170
|
+
* current delay and returns a new delay wrapped in an `Effect`.
|
|
1171
|
+
*
|
|
1172
|
+
* This is useful for adaptive scheduling where delays depend on external
|
|
1173
|
+
* factors, such as API calls, database queries, or dynamic system conditions.
|
|
1174
|
+
*
|
|
1175
|
+
* @see {@link delayed} If you need to compute the delay using a pure function.
|
|
587
1176
|
*
|
|
588
1177
|
* @since 2.0.0
|
|
589
|
-
* @category
|
|
1178
|
+
* @category Timing & Delay
|
|
590
1179
|
*/
|
|
591
1180
|
<R2>(f: (duration: Duration.Duration) => Effect.Effect<Duration.DurationInput, never, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
592
1181
|
/**
|
|
593
|
-
*
|
|
594
|
-
*
|
|
1182
|
+
* Modifies a schedule by adding an effectfully computed delay before each
|
|
1183
|
+
* execution.
|
|
1184
|
+
*
|
|
1185
|
+
* **Details**
|
|
1186
|
+
*
|
|
1187
|
+
* This function adjusts an existing schedule by introducing a delay that is
|
|
1188
|
+
* computed via an effect. Instead of using a fixed delay, each interval is
|
|
1189
|
+
* dynamically adjusted based on an effectful function `f`, which takes the
|
|
1190
|
+
* current delay and returns a new delay wrapped in an `Effect`.
|
|
1191
|
+
*
|
|
1192
|
+
* This is useful for adaptive scheduling where delays depend on external
|
|
1193
|
+
* factors, such as API calls, database queries, or dynamic system conditions.
|
|
1194
|
+
*
|
|
1195
|
+
* @see {@link delayed} If you need to compute the delay using a pure function.
|
|
595
1196
|
*
|
|
596
1197
|
* @since 2.0.0
|
|
597
|
-
* @category
|
|
1198
|
+
* @category Timing & Delay
|
|
598
1199
|
*/
|
|
599
1200
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, f: (duration: Duration.Duration) => Effect.Effect<Duration.DurationInput, never, R2>): Schedule<Out, In, R | R2>;
|
|
600
1201
|
};
|
|
601
1202
|
/**
|
|
602
|
-
*
|
|
603
|
-
*
|
|
1203
|
+
* Uses the delays produced by a schedule to further delay its intervals.
|
|
1204
|
+
*
|
|
1205
|
+
* **Details**
|
|
1206
|
+
*
|
|
1207
|
+
* This function modifies a schedule by using its own output delays to control
|
|
1208
|
+
* its execution timing. Instead of executing immediately at each interval, the
|
|
1209
|
+
* schedule will be delayed by the duration it produces.
|
|
604
1210
|
*
|
|
605
1211
|
* @since 2.0.0
|
|
606
|
-
* @category
|
|
1212
|
+
* @category Timing & Delay
|
|
607
1213
|
*/
|
|
608
1214
|
export declare const delayedSchedule: <In, R>(schedule: Schedule<Duration.Duration, In, R>) => Schedule<Duration.Duration, In, R>;
|
|
609
1215
|
/**
|
|
610
|
-
*
|
|
1216
|
+
* Transforms a schedule to output the delay between each occurrence.
|
|
1217
|
+
*
|
|
1218
|
+
* **Details**
|
|
1219
|
+
*
|
|
1220
|
+
* This function modifies an existing schedule so that instead of producing its
|
|
1221
|
+
* original output, it now returns the delay between each scheduled execution.
|
|
611
1222
|
*
|
|
612
1223
|
* @since 2.0.0
|
|
613
|
-
* @category
|
|
1224
|
+
* @category Monitoring
|
|
614
1225
|
*/
|
|
615
1226
|
export declare const delays: <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Duration.Duration, In, R>;
|
|
616
1227
|
/**
|
|
617
|
-
*
|
|
1228
|
+
* Transforms both the input and output of a schedule.
|
|
1229
|
+
*
|
|
1230
|
+
* **Details**
|
|
1231
|
+
*
|
|
1232
|
+
* This function modifies an existing schedule by applying a transformation to
|
|
1233
|
+
* both its input values and its output values. The provided transformation
|
|
1234
|
+
* functions `onInput` and `onOutput` allow you to map the schedule to work with
|
|
1235
|
+
* a different input type while modifying its outputs as well.
|
|
1236
|
+
*
|
|
1237
|
+
* @see {@link mapBothEffect} If you need to use effectful transformation functions.
|
|
618
1238
|
*
|
|
619
1239
|
* @since 2.0.0
|
|
620
|
-
* @category
|
|
1240
|
+
* @category Mapping
|
|
621
1241
|
*/
|
|
622
1242
|
export declare const mapBoth: {
|
|
623
1243
|
/**
|
|
624
|
-
*
|
|
1244
|
+
* Transforms both the input and output of a schedule.
|
|
1245
|
+
*
|
|
1246
|
+
* **Details**
|
|
1247
|
+
*
|
|
1248
|
+
* This function modifies an existing schedule by applying a transformation to
|
|
1249
|
+
* both its input values and its output values. The provided transformation
|
|
1250
|
+
* functions `onInput` and `onOutput` allow you to map the schedule to work with
|
|
1251
|
+
* a different input type while modifying its outputs as well.
|
|
1252
|
+
*
|
|
1253
|
+
* @see {@link mapBothEffect} If you need to use effectful transformation functions.
|
|
625
1254
|
*
|
|
626
1255
|
* @since 2.0.0
|
|
627
|
-
* @category
|
|
1256
|
+
* @category Mapping
|
|
628
1257
|
*/
|
|
629
1258
|
<In2, In, Out, Out2>(options: {
|
|
630
1259
|
readonly onInput: (in2: In2) => In;
|
|
631
1260
|
readonly onOutput: (out: Out) => Out2;
|
|
632
1261
|
}): <R>(self: Schedule<Out, In, R>) => Schedule<Out2, In2, R>;
|
|
633
1262
|
/**
|
|
634
|
-
*
|
|
1263
|
+
* Transforms both the input and output of a schedule.
|
|
1264
|
+
*
|
|
1265
|
+
* **Details**
|
|
1266
|
+
*
|
|
1267
|
+
* This function modifies an existing schedule by applying a transformation to
|
|
1268
|
+
* both its input values and its output values. The provided transformation
|
|
1269
|
+
* functions `onInput` and `onOutput` allow you to map the schedule to work with
|
|
1270
|
+
* a different input type while modifying its outputs as well.
|
|
1271
|
+
*
|
|
1272
|
+
* @see {@link mapBothEffect} If you need to use effectful transformation functions.
|
|
635
1273
|
*
|
|
636
1274
|
* @since 2.0.0
|
|
637
|
-
* @category
|
|
1275
|
+
* @category Mapping
|
|
638
1276
|
*/
|
|
639
1277
|
<Out, In, R, In2, Out2>(self: Schedule<Out, In, R>, options: {
|
|
640
1278
|
readonly onInput: (in2: In2) => In;
|
|
@@ -642,27 +1280,60 @@ export declare const mapBoth: {
|
|
|
642
1280
|
}): Schedule<Out2, In2, R>;
|
|
643
1281
|
};
|
|
644
1282
|
/**
|
|
645
|
-
*
|
|
1283
|
+
* Transforms both the input and output of a schedule using effectful
|
|
1284
|
+
* computations.
|
|
1285
|
+
*
|
|
1286
|
+
* **Details**
|
|
1287
|
+
*
|
|
1288
|
+
* This function modifies an existing schedule by applying effectful
|
|
1289
|
+
* transformations to both its input values and its output values. The provided
|
|
1290
|
+
* effectful functions `onInput` and `onOutput` allow you to transform inputs
|
|
1291
|
+
* and outputs using computations that may involve additional logic, resource
|
|
1292
|
+
* access, or side effects.
|
|
1293
|
+
*
|
|
1294
|
+
* @see {@link mapBoth} If you need to use pure transformation functions.
|
|
646
1295
|
*
|
|
647
1296
|
* @since 2.0.0
|
|
648
|
-
* @category
|
|
1297
|
+
* @category Mapping
|
|
649
1298
|
*/
|
|
650
1299
|
export declare const mapBothEffect: {
|
|
651
1300
|
/**
|
|
652
|
-
*
|
|
1301
|
+
* Transforms both the input and output of a schedule using effectful
|
|
1302
|
+
* computations.
|
|
1303
|
+
*
|
|
1304
|
+
* **Details**
|
|
1305
|
+
*
|
|
1306
|
+
* This function modifies an existing schedule by applying effectful
|
|
1307
|
+
* transformations to both its input values and its output values. The provided
|
|
1308
|
+
* effectful functions `onInput` and `onOutput` allow you to transform inputs
|
|
1309
|
+
* and outputs using computations that may involve additional logic, resource
|
|
1310
|
+
* access, or side effects.
|
|
1311
|
+
*
|
|
1312
|
+
* @see {@link mapBoth} If you need to use pure transformation functions.
|
|
653
1313
|
*
|
|
654
1314
|
* @since 2.0.0
|
|
655
|
-
* @category
|
|
1315
|
+
* @category Mapping
|
|
656
1316
|
*/
|
|
657
1317
|
<In2, In, R2, Out, R3, Out2>(options: {
|
|
658
1318
|
readonly onInput: (input: In2) => Effect.Effect<In, never, R2>;
|
|
659
1319
|
readonly onOutput: (out: Out) => Effect.Effect<Out2, never, R3>;
|
|
660
1320
|
}): <R>(self: Schedule<Out, In, R>) => Schedule<Out2, In2, R2 | R3 | R>;
|
|
661
1321
|
/**
|
|
662
|
-
*
|
|
1322
|
+
* Transforms both the input and output of a schedule using effectful
|
|
1323
|
+
* computations.
|
|
1324
|
+
*
|
|
1325
|
+
* **Details**
|
|
1326
|
+
*
|
|
1327
|
+
* This function modifies an existing schedule by applying effectful
|
|
1328
|
+
* transformations to both its input values and its output values. The provided
|
|
1329
|
+
* effectful functions `onInput` and `onOutput` allow you to transform inputs
|
|
1330
|
+
* and outputs using computations that may involve additional logic, resource
|
|
1331
|
+
* access, or side effects.
|
|
1332
|
+
*
|
|
1333
|
+
* @see {@link mapBoth} If you need to use pure transformation functions.
|
|
663
1334
|
*
|
|
664
1335
|
* @since 2.0.0
|
|
665
|
-
* @category
|
|
1336
|
+
* @category Mapping
|
|
666
1337
|
*/
|
|
667
1338
|
<Out, In, R, In2, R2, Out2, R3>(self: Schedule<Out, In, R>, options: {
|
|
668
1339
|
readonly onInput: (input: In2) => Effect.Effect<In, never, R2>;
|
|
@@ -670,292 +1341,512 @@ export declare const mapBothEffect: {
|
|
|
670
1341
|
}): Schedule<Out2, In2, R | R2 | R3>;
|
|
671
1342
|
};
|
|
672
1343
|
/**
|
|
673
|
-
*
|
|
674
|
-
*
|
|
1344
|
+
* Creates a driver to manually control the execution of a schedule.
|
|
1345
|
+
*
|
|
1346
|
+
* **Details**
|
|
1347
|
+
*
|
|
1348
|
+
* This function returns a `ScheduleDriver`, which allows stepping through a
|
|
1349
|
+
* schedule manually while handling delays and sleeping appropriately. A driver
|
|
1350
|
+
* is useful when you need fine-grained control over how a schedule progresses,
|
|
1351
|
+
* rather than relying on automatic execution.
|
|
1352
|
+
*
|
|
1353
|
+
* The returned driver exposes methods for retrieving the current state,
|
|
1354
|
+
* executing the next step, and resetting the schedule when needed.
|
|
675
1355
|
*
|
|
676
1356
|
* @since 2.0.0
|
|
677
1357
|
* @category getter
|
|
678
1358
|
*/
|
|
679
1359
|
export declare const driver: <Out, In, R>(self: Schedule<Out, In, R>) => Effect.Effect<ScheduleDriver<Out, In, R>>;
|
|
680
1360
|
/**
|
|
681
|
-
*
|
|
682
|
-
* future.
|
|
1361
|
+
* Alias of {@link fromDelay}.
|
|
683
1362
|
*
|
|
684
1363
|
* @since 2.0.0
|
|
685
|
-
* @category
|
|
1364
|
+
* @category Constructors
|
|
686
1365
|
*/
|
|
687
1366
|
export declare const duration: (duration: Duration.DurationInput) => Schedule<Duration.Duration>;
|
|
688
1367
|
/**
|
|
689
|
-
*
|
|
690
|
-
* defined by both schedules.
|
|
1368
|
+
* Alias of {@link union}.
|
|
691
1369
|
*
|
|
692
1370
|
* @since 2.0.0
|
|
693
|
-
* @category
|
|
1371
|
+
* @category Alternatives
|
|
694
1372
|
*/
|
|
695
1373
|
export declare const either: {
|
|
696
1374
|
/**
|
|
697
|
-
*
|
|
698
|
-
* defined by both schedules.
|
|
1375
|
+
* Alias of {@link union}.
|
|
699
1376
|
*
|
|
700
1377
|
* @since 2.0.0
|
|
701
|
-
* @category
|
|
1378
|
+
* @category Alternatives
|
|
702
1379
|
*/
|
|
703
1380
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<[Out, Out2], In & In2, R2 | R>;
|
|
704
1381
|
/**
|
|
705
|
-
*
|
|
706
|
-
* defined by both schedules.
|
|
1382
|
+
* Alias of {@link union}.
|
|
707
1383
|
*
|
|
708
1384
|
* @since 2.0.0
|
|
709
|
-
* @category
|
|
1385
|
+
* @category Alternatives
|
|
710
1386
|
*/
|
|
711
1387
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<[Out, Out2], In & In2, R | R2>;
|
|
712
1388
|
};
|
|
713
1389
|
/**
|
|
714
|
-
*
|
|
1390
|
+
* Alias of {@link unionWith}.
|
|
715
1391
|
*
|
|
716
1392
|
* @since 2.0.0
|
|
717
|
-
* @category
|
|
1393
|
+
* @category Alternatives
|
|
718
1394
|
*/
|
|
719
1395
|
export declare const eitherWith: {
|
|
720
1396
|
/**
|
|
721
|
-
*
|
|
1397
|
+
* Alias of {@link unionWith}.
|
|
722
1398
|
*
|
|
723
1399
|
* @since 2.0.0
|
|
724
|
-
* @category
|
|
1400
|
+
* @category Alternatives
|
|
725
1401
|
*/
|
|
726
1402
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>, f: (x: Intervals.Intervals, y: Intervals.Intervals) => Intervals.Intervals): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<[Out, Out2], In & In2, R2 | R>;
|
|
727
1403
|
/**
|
|
728
|
-
*
|
|
1404
|
+
* Alias of {@link unionWith}.
|
|
729
1405
|
*
|
|
730
1406
|
* @since 2.0.0
|
|
731
|
-
* @category
|
|
1407
|
+
* @category Alternatives
|
|
732
1408
|
*/
|
|
733
1409
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>, f: (x: Intervals.Intervals, y: Intervals.Intervals) => Intervals.Intervals): Schedule<[Out, Out2], In & In2, R | R2>;
|
|
734
1410
|
};
|
|
735
1411
|
/**
|
|
736
|
-
*
|
|
737
|
-
* since the first step.
|
|
1412
|
+
* Creates a schedule that tracks the total elapsed duration since it started.
|
|
738
1413
|
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
1414
|
+
* **Details**
|
|
1415
|
+
*
|
|
1416
|
+
* This schedule executes continuously and returns the total time that has
|
|
1417
|
+
* passed since the first execution. The duration keeps increasing with each
|
|
1418
|
+
* step, providing a way to measure elapsed time.
|
|
1419
|
+
*
|
|
1420
|
+
* This is useful for tracking execution time, monitoring delays, or
|
|
1421
|
+
* implementing logic based on how long a process has been running.
|
|
1422
|
+
*
|
|
1423
|
+
* @since 2.0.0
|
|
1424
|
+
* @category Constructors
|
|
741
1425
|
*/
|
|
742
1426
|
export declare const elapsed: Schedule<Duration.Duration>;
|
|
743
1427
|
/**
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
1428
|
+
* Attaches a finalizer to a schedule that runs when the schedule completes.
|
|
1429
|
+
*
|
|
1430
|
+
* **Details**
|
|
1431
|
+
*
|
|
1432
|
+
* This function returns a new schedule that executes a given finalizer when the
|
|
1433
|
+
* schedule reaches completion. Unlike `Effect.ensuring`, this method does not
|
|
1434
|
+
* guarantee the finalizer will run in all cases. If the schedule never
|
|
1435
|
+
* initializes or is not driven to completion, the finalizer may not execute.
|
|
1436
|
+
* However, if the schedule decides not to continue, the finalizer will be
|
|
1437
|
+
* invoked.
|
|
1438
|
+
*
|
|
1439
|
+
* This is useful for cleaning up resources, logging, or executing other side
|
|
1440
|
+
* effects when a schedule completes.
|
|
749
1441
|
*
|
|
750
1442
|
* @since 2.0.0
|
|
751
|
-
* @category
|
|
1443
|
+
* @category Finalization
|
|
752
1444
|
*/
|
|
753
1445
|
export declare const ensuring: {
|
|
754
1446
|
/**
|
|
755
|
-
*
|
|
756
|
-
*
|
|
757
|
-
*
|
|
758
|
-
*
|
|
759
|
-
*
|
|
1447
|
+
* Attaches a finalizer to a schedule that runs when the schedule completes.
|
|
1448
|
+
*
|
|
1449
|
+
* **Details**
|
|
1450
|
+
*
|
|
1451
|
+
* This function returns a new schedule that executes a given finalizer when the
|
|
1452
|
+
* schedule reaches completion. Unlike `Effect.ensuring`, this method does not
|
|
1453
|
+
* guarantee the finalizer will run in all cases. If the schedule never
|
|
1454
|
+
* initializes or is not driven to completion, the finalizer may not execute.
|
|
1455
|
+
* However, if the schedule decides not to continue, the finalizer will be
|
|
1456
|
+
* invoked.
|
|
1457
|
+
*
|
|
1458
|
+
* This is useful for cleaning up resources, logging, or executing other side
|
|
1459
|
+
* effects when a schedule completes.
|
|
760
1460
|
*
|
|
761
1461
|
* @since 2.0.0
|
|
762
|
-
* @category
|
|
1462
|
+
* @category Finalization
|
|
763
1463
|
*/
|
|
764
1464
|
<X>(finalizer: Effect.Effect<X, never, never>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
765
1465
|
/**
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
1466
|
+
* Attaches a finalizer to a schedule that runs when the schedule completes.
|
|
1467
|
+
*
|
|
1468
|
+
* **Details**
|
|
1469
|
+
*
|
|
1470
|
+
* This function returns a new schedule that executes a given finalizer when the
|
|
1471
|
+
* schedule reaches completion. Unlike `Effect.ensuring`, this method does not
|
|
1472
|
+
* guarantee the finalizer will run in all cases. If the schedule never
|
|
1473
|
+
* initializes or is not driven to completion, the finalizer may not execute.
|
|
1474
|
+
* However, if the schedule decides not to continue, the finalizer will be
|
|
1475
|
+
* invoked.
|
|
1476
|
+
*
|
|
1477
|
+
* This is useful for cleaning up resources, logging, or executing other side
|
|
1478
|
+
* effects when a schedule completes.
|
|
771
1479
|
*
|
|
772
1480
|
* @since 2.0.0
|
|
773
|
-
* @category
|
|
1481
|
+
* @category Finalization
|
|
774
1482
|
*/
|
|
775
1483
|
<Out, In, R, X>(self: Schedule<Out, In, R>, finalizer: Effect.Effect<X, never, never>): Schedule<Out, In, R>;
|
|
776
1484
|
};
|
|
777
1485
|
/**
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
*
|
|
1486
|
+
* Creates a schedule that recurs indefinitely with exponentially increasing
|
|
1487
|
+
* delays.
|
|
1488
|
+
*
|
|
1489
|
+
* **Details**
|
|
1490
|
+
*
|
|
1491
|
+
* This schedule starts with an initial delay of `base` and increases the delay
|
|
1492
|
+
* exponentially on each repetition using the formula `base * factor^n`, where
|
|
1493
|
+
* `n` is the number of times the schedule has executed so far. If no `factor`
|
|
1494
|
+
* is provided, it defaults to `2`, causing the delay to double after each
|
|
1495
|
+
* execution.
|
|
781
1496
|
*
|
|
782
1497
|
* @since 2.0.0
|
|
783
|
-
* @category
|
|
1498
|
+
* @category Constructors
|
|
784
1499
|
*/
|
|
785
1500
|
export declare const exponential: (base: Duration.DurationInput, factor?: number) => Schedule<Duration.Duration>;
|
|
786
1501
|
/**
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
1502
|
+
* Creates a schedule that recurs indefinitely with Fibonacci-based increasing
|
|
1503
|
+
* delays.
|
|
1504
|
+
*
|
|
1505
|
+
* **Details**
|
|
1506
|
+
*
|
|
1507
|
+
* This schedule starts with an initial delay of `one` and increases subsequent
|
|
1508
|
+
* delays by summing the two previous delays, following the Fibonacci sequence.
|
|
1509
|
+
* The delay pattern follows: `one, one, one + one, (one + one) + one, ...`,
|
|
1510
|
+
* resulting in `1s, 1s, 2s, 3s, 5s, 8s, 13s, ...` if `one = 1s`.
|
|
1511
|
+
*
|
|
1512
|
+
* This is useful for progressive backoff strategies, where delays grow
|
|
1513
|
+
* naturally over time without increasing as aggressively as an exponential
|
|
1514
|
+
* schedule.
|
|
790
1515
|
*
|
|
791
1516
|
* @since 2.0.0
|
|
792
|
-
* @category
|
|
1517
|
+
* @category Constructors
|
|
793
1518
|
*/
|
|
794
1519
|
export declare const fibonacci: (one: Duration.DurationInput) => Schedule<Duration.Duration>;
|
|
795
1520
|
/**
|
|
796
|
-
*
|
|
797
|
-
*
|
|
1521
|
+
* Creates a schedule that recurs at a fixed interval.
|
|
1522
|
+
*
|
|
1523
|
+
* **Details**
|
|
798
1524
|
*
|
|
799
|
-
*
|
|
800
|
-
*
|
|
1525
|
+
* This schedule executes at regular, evenly spaced intervals, returning the
|
|
1526
|
+
* number of times it has run so far. If the action being executed takes longer
|
|
1527
|
+
* than the interval, the next execution will happen immediately to prevent
|
|
1528
|
+
* "pile-ups," ensuring that the schedule remains consistent without overlapping
|
|
1529
|
+
* executions.
|
|
801
1530
|
*
|
|
802
1531
|
* ```
|
|
803
1532
|
* |-----interval-----|-----interval-----|-----interval-----|
|
|
804
1533
|
* |---------action--------||action|-----|action|-----------|
|
|
805
1534
|
* ```
|
|
806
1535
|
*
|
|
1536
|
+
* @see {@link spaced} If you need to run from the end of the last execution.
|
|
1537
|
+
*
|
|
807
1538
|
* @since 2.0.0
|
|
808
|
-
* @category
|
|
1539
|
+
* @category Constructors
|
|
809
1540
|
*/
|
|
810
1541
|
export declare const fixed: (interval: Duration.DurationInput) => Schedule<number>;
|
|
811
1542
|
/**
|
|
812
|
-
*
|
|
1543
|
+
* Creates a schedule that recurs indefinitely, producing a count of
|
|
1544
|
+
* repetitions.
|
|
1545
|
+
*
|
|
1546
|
+
* **Details**
|
|
1547
|
+
*
|
|
1548
|
+
* This schedule runs indefinitely, returning an increasing count of executions
|
|
1549
|
+
* (`0, 1, 2, 3, ...`). Each step increments the count by one, allowing tracking
|
|
1550
|
+
* of how many times it has executed.
|
|
813
1551
|
*
|
|
814
1552
|
* @since 2.0.0
|
|
815
|
-
* @category
|
|
1553
|
+
* @category Constructors
|
|
816
1554
|
*/
|
|
817
1555
|
export declare const forever: Schedule<number>;
|
|
818
1556
|
/**
|
|
819
|
-
*
|
|
1557
|
+
* Creates a schedule that recurs once after a specified duration.
|
|
1558
|
+
*
|
|
1559
|
+
* **Details**
|
|
1560
|
+
*
|
|
1561
|
+
* This schedule executes a single time after waiting for the given duration.
|
|
1562
|
+
* Once it has executed, it does not repeat.
|
|
1563
|
+
*
|
|
1564
|
+
* @see {@link fromDelays} If you need to create a schedule with multiple delays.
|
|
820
1565
|
*
|
|
821
1566
|
* @since 2.0.0
|
|
822
|
-
* @category
|
|
1567
|
+
* @category Constructors
|
|
823
1568
|
*/
|
|
824
1569
|
export declare const fromDelay: (delay: Duration.DurationInput) => Schedule<Duration.Duration>;
|
|
825
1570
|
/**
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
*
|
|
1571
|
+
* Creates a schedule that recurs once for each specified duration, applying the
|
|
1572
|
+
* given delays sequentially.
|
|
1573
|
+
*
|
|
1574
|
+
* **Details**
|
|
1575
|
+
*
|
|
1576
|
+
* This schedule executes multiple times, each time waiting for the
|
|
1577
|
+
* corresponding duration from the provided list of delays. The first execution
|
|
1578
|
+
* waits for `delay`, the next for the second value in `delays`, and so on. Once
|
|
1579
|
+
* all delays have been used, the schedule stops executing.
|
|
1580
|
+
*
|
|
1581
|
+
* This is useful for defining a custom delay sequence that does not follow a
|
|
1582
|
+
* fixed pattern like exponential or Fibonacci backoff.
|
|
829
1583
|
*
|
|
830
1584
|
* @since 2.0.0
|
|
831
|
-
* @category
|
|
1585
|
+
* @category Constructors
|
|
832
1586
|
*/
|
|
833
1587
|
export declare const fromDelays: (delay: Duration.DurationInput, ...delays: Array<Duration.DurationInput>) => Schedule<Duration.Duration>;
|
|
834
1588
|
/**
|
|
835
|
-
*
|
|
836
|
-
* function.
|
|
1589
|
+
* Creates a schedule that always recurs, transforming input values using the
|
|
1590
|
+
* specified function.
|
|
1591
|
+
*
|
|
1592
|
+
* **Details**
|
|
1593
|
+
*
|
|
1594
|
+
* This schedule continuously executes and applies the given function `f` to
|
|
1595
|
+
* each input value, producing a transformed output. The schedule itself does
|
|
1596
|
+
* not control delays or stopping conditions; it simply transforms the input
|
|
1597
|
+
* values as they are processed.
|
|
1598
|
+
*
|
|
1599
|
+
* This is useful when defining schedules that map inputs to outputs, allowing
|
|
1600
|
+
* dynamic transformations of incoming data.
|
|
837
1601
|
*
|
|
838
1602
|
* @since 2.0.0
|
|
839
|
-
* @category
|
|
1603
|
+
* @category Constructors
|
|
840
1604
|
*/
|
|
841
1605
|
export declare const fromFunction: <A, B>(f: (a: A) => B) => Schedule<B, A>;
|
|
842
1606
|
/**
|
|
843
|
-
*
|
|
844
|
-
*
|
|
1607
|
+
* Creates a schedule that always recurs, passing inputs directly as outputs.
|
|
1608
|
+
*
|
|
1609
|
+
* **Details**
|
|
845
1610
|
*
|
|
846
|
-
*
|
|
1611
|
+
* This schedule runs indefinitely, returning each input value as its output
|
|
1612
|
+
* without modification. It effectively acts as a pass-through that simply
|
|
1613
|
+
* echoes its input values at each step.
|
|
847
1614
|
*
|
|
848
1615
|
* @since 2.0.0
|
|
849
|
-
* @category
|
|
1616
|
+
* @category Constructors
|
|
850
1617
|
*/
|
|
851
|
-
export declare const
|
|
1618
|
+
export declare const identity: <A>() => Schedule<A, A>;
|
|
852
1619
|
/**
|
|
853
|
-
*
|
|
1620
|
+
* Transforms a schedule to pass through its inputs as outputs.
|
|
1621
|
+
*
|
|
1622
|
+
* **Details**
|
|
1623
|
+
*
|
|
1624
|
+
* This function modifies an existing schedule so that it returns its input
|
|
1625
|
+
* values instead of its original output values. The schedule's timing remains
|
|
1626
|
+
* unchanged, but its outputs are replaced with whatever inputs it receives.
|
|
854
1627
|
*
|
|
855
1628
|
* @since 2.0.0
|
|
856
|
-
* @category constructors
|
|
857
1629
|
*/
|
|
858
|
-
export declare const
|
|
1630
|
+
export declare const passthrough: <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<In, In, R>;
|
|
859
1631
|
/**
|
|
860
|
-
*
|
|
861
|
-
*
|
|
1632
|
+
* Combines two schedules, continuing only if both schedules want to continue,
|
|
1633
|
+
* using the longer delay.
|
|
1634
|
+
*
|
|
1635
|
+
* **Details**
|
|
1636
|
+
*
|
|
1637
|
+
* This function takes two schedules and creates a new schedule that only
|
|
1638
|
+
* continues execution if both schedules allow it. The interval between
|
|
1639
|
+
* recurrences is determined by the longer delay between the two schedules.
|
|
1640
|
+
*
|
|
1641
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
1642
|
+
* both schedules. The input type is the intersection of both schedules' input
|
|
1643
|
+
* types.
|
|
1644
|
+
*
|
|
1645
|
+
* This is useful when coordinating multiple scheduling conditions where
|
|
1646
|
+
* execution should proceed only when both schedules permit it.
|
|
1647
|
+
*
|
|
1648
|
+
* @see {@link intersectWith} If you need to use a custom merge function.
|
|
862
1649
|
*
|
|
863
1650
|
* @since 2.0.0
|
|
864
|
-
* @category
|
|
1651
|
+
* @category Composition
|
|
865
1652
|
*/
|
|
866
1653
|
export declare const intersect: {
|
|
867
1654
|
/**
|
|
868
|
-
*
|
|
869
|
-
*
|
|
1655
|
+
* Combines two schedules, continuing only if both schedules want to continue,
|
|
1656
|
+
* using the longer delay.
|
|
1657
|
+
*
|
|
1658
|
+
* **Details**
|
|
1659
|
+
*
|
|
1660
|
+
* This function takes two schedules and creates a new schedule that only
|
|
1661
|
+
* continues execution if both schedules allow it. The interval between
|
|
1662
|
+
* recurrences is determined by the longer delay between the two schedules.
|
|
1663
|
+
*
|
|
1664
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
1665
|
+
* both schedules. The input type is the intersection of both schedules' input
|
|
1666
|
+
* types.
|
|
1667
|
+
*
|
|
1668
|
+
* This is useful when coordinating multiple scheduling conditions where
|
|
1669
|
+
* execution should proceed only when both schedules permit it.
|
|
1670
|
+
*
|
|
1671
|
+
* @see {@link intersectWith} If you need to use a custom merge function.
|
|
870
1672
|
*
|
|
871
1673
|
* @since 2.0.0
|
|
872
|
-
* @category
|
|
1674
|
+
* @category Composition
|
|
873
1675
|
*/
|
|
874
1676
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<[Out, Out2], In & In2, R2 | R>;
|
|
875
1677
|
/**
|
|
876
|
-
*
|
|
877
|
-
*
|
|
1678
|
+
* Combines two schedules, continuing only if both schedules want to continue,
|
|
1679
|
+
* using the longer delay.
|
|
1680
|
+
*
|
|
1681
|
+
* **Details**
|
|
1682
|
+
*
|
|
1683
|
+
* This function takes two schedules and creates a new schedule that only
|
|
1684
|
+
* continues execution if both schedules allow it. The interval between
|
|
1685
|
+
* recurrences is determined by the longer delay between the two schedules.
|
|
1686
|
+
*
|
|
1687
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
1688
|
+
* both schedules. The input type is the intersection of both schedules' input
|
|
1689
|
+
* types.
|
|
1690
|
+
*
|
|
1691
|
+
* This is useful when coordinating multiple scheduling conditions where
|
|
1692
|
+
* execution should proceed only when both schedules permit it.
|
|
1693
|
+
*
|
|
1694
|
+
* @see {@link intersectWith} If you need to use a custom merge function.
|
|
878
1695
|
*
|
|
879
1696
|
* @since 2.0.0
|
|
880
|
-
* @category
|
|
1697
|
+
* @category Composition
|
|
881
1698
|
*/
|
|
882
1699
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<[Out, Out2], In & In2, R | R2>;
|
|
883
1700
|
};
|
|
884
1701
|
/**
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
*
|
|
1702
|
+
* Combines two schedules, continuing only if both want to continue, merging
|
|
1703
|
+
* intervals using a custom function.
|
|
1704
|
+
*
|
|
1705
|
+
* **Details**
|
|
1706
|
+
*
|
|
1707
|
+
* This function takes two schedules and creates a new schedule that only
|
|
1708
|
+
* continues execution if both schedules allow it. Instead of automatically
|
|
1709
|
+
* using the longer delay (like {@link intersect}), this function applies a
|
|
1710
|
+
* user-provided merge function `f` to determine the next interval between
|
|
1711
|
+
* executions.
|
|
1712
|
+
*
|
|
1713
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
1714
|
+
* both schedules, and the input type is the intersection of both schedules'
|
|
1715
|
+
* input types.
|
|
888
1716
|
*
|
|
889
1717
|
* @since 2.0.0
|
|
890
|
-
* @category
|
|
1718
|
+
* @category Composition
|
|
891
1719
|
*/
|
|
892
1720
|
export declare const intersectWith: {
|
|
893
1721
|
/**
|
|
894
|
-
*
|
|
895
|
-
*
|
|
896
|
-
*
|
|
1722
|
+
* Combines two schedules, continuing only if both want to continue, merging
|
|
1723
|
+
* intervals using a custom function.
|
|
1724
|
+
*
|
|
1725
|
+
* **Details**
|
|
1726
|
+
*
|
|
1727
|
+
* This function takes two schedules and creates a new schedule that only
|
|
1728
|
+
* continues execution if both schedules allow it. Instead of automatically
|
|
1729
|
+
* using the longer delay (like {@link intersect}), this function applies a
|
|
1730
|
+
* user-provided merge function `f` to determine the next interval between
|
|
1731
|
+
* executions.
|
|
1732
|
+
*
|
|
1733
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
1734
|
+
* both schedules, and the input type is the intersection of both schedules'
|
|
1735
|
+
* input types.
|
|
897
1736
|
*
|
|
898
1737
|
* @since 2.0.0
|
|
899
|
-
* @category
|
|
1738
|
+
* @category Composition
|
|
900
1739
|
*/
|
|
901
1740
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>, f: (x: Intervals.Intervals, y: Intervals.Intervals) => Intervals.Intervals): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<[Out, Out2], In & In2, R2 | R>;
|
|
902
1741
|
/**
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
*
|
|
1742
|
+
* Combines two schedules, continuing only if both want to continue, merging
|
|
1743
|
+
* intervals using a custom function.
|
|
1744
|
+
*
|
|
1745
|
+
* **Details**
|
|
1746
|
+
*
|
|
1747
|
+
* This function takes two schedules and creates a new schedule that only
|
|
1748
|
+
* continues execution if both schedules allow it. Instead of automatically
|
|
1749
|
+
* using the longer delay (like {@link intersect}), this function applies a
|
|
1750
|
+
* user-provided merge function `f` to determine the next interval between
|
|
1751
|
+
* executions.
|
|
1752
|
+
*
|
|
1753
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
1754
|
+
* both schedules, and the input type is the intersection of both schedules'
|
|
1755
|
+
* input types.
|
|
906
1756
|
*
|
|
907
1757
|
* @since 2.0.0
|
|
908
|
-
* @category
|
|
1758
|
+
* @category Composition
|
|
909
1759
|
*/
|
|
910
1760
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>, f: (x: Intervals.Intervals, y: Intervals.Intervals) => Intervals.Intervals): Schedule<[Out, Out2], In & In2, R | R2>;
|
|
911
1761
|
};
|
|
912
1762
|
/**
|
|
913
|
-
* Returns a new schedule that randomly
|
|
914
|
-
*
|
|
1763
|
+
* Returns a new schedule that randomly adjusts the interval size within a
|
|
1764
|
+
* range.
|
|
915
1765
|
*
|
|
916
|
-
*
|
|
1766
|
+
* **Details**
|
|
917
1767
|
*
|
|
918
|
-
*
|
|
919
|
-
*
|
|
1768
|
+
* This function modifies a schedule so that its delay between executions is
|
|
1769
|
+
* randomly varied within a range. By default, the delay is adjusted between
|
|
1770
|
+
* `80%` (`0.8 * interval`) and `120%` (`1.2 * interval`) of the original
|
|
1771
|
+
* interval size.
|
|
1772
|
+
*
|
|
1773
|
+
* This is useful for adding randomness to repeated executions, reducing
|
|
1774
|
+
* contention in distributed systems, and avoiding synchronized execution
|
|
1775
|
+
* patterns that can cause bottlenecks.
|
|
1776
|
+
*
|
|
1777
|
+
* @see {@link jitteredWith} If you need to specify custom min/max values.
|
|
920
1778
|
*
|
|
921
1779
|
* @since 2.0.0
|
|
922
|
-
* @category
|
|
1780
|
+
* @category Timing & Delay
|
|
923
1781
|
*/
|
|
924
1782
|
export declare const jittered: <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
925
1783
|
/**
|
|
926
|
-
* Returns a new schedule that randomly
|
|
927
|
-
*
|
|
1784
|
+
* Returns a new schedule that randomly adjusts the interval size within a
|
|
1785
|
+
* user-defined range.
|
|
1786
|
+
*
|
|
1787
|
+
* **Details**
|
|
928
1788
|
*
|
|
929
|
-
*
|
|
930
|
-
*
|
|
1789
|
+
* This function modifies a schedule so that its delay between executions is
|
|
1790
|
+
* randomly varied within a specified range. Instead of using the default `0.8 -
|
|
1791
|
+
* 1.2` range like {@link jittered}, this function allows customizing the `min`
|
|
1792
|
+
* and `max` multipliers.
|
|
1793
|
+
*
|
|
1794
|
+
* The delay for each step will be adjusted within `min * original_interval` and
|
|
1795
|
+
* `max * original_interval`. If `min` and `max` are not provided, the defaults
|
|
1796
|
+
* are `0.8` and `1.2`, respectively.
|
|
1797
|
+
*
|
|
1798
|
+
* This is useful for introducing randomness into scheduling behavior while
|
|
1799
|
+
* having precise control over the jitter range.
|
|
931
1800
|
*
|
|
932
1801
|
* @since 2.0.0
|
|
933
|
-
* @category
|
|
1802
|
+
* @category Timing & Delay
|
|
934
1803
|
*/
|
|
935
1804
|
export declare const jitteredWith: {
|
|
936
1805
|
/**
|
|
937
|
-
* Returns a new schedule that randomly
|
|
938
|
-
*
|
|
1806
|
+
* Returns a new schedule that randomly adjusts the interval size within a
|
|
1807
|
+
* user-defined range.
|
|
1808
|
+
*
|
|
1809
|
+
* **Details**
|
|
939
1810
|
*
|
|
940
|
-
*
|
|
941
|
-
*
|
|
1811
|
+
* This function modifies a schedule so that its delay between executions is
|
|
1812
|
+
* randomly varied within a specified range. Instead of using the default `0.8 -
|
|
1813
|
+
* 1.2` range like {@link jittered}, this function allows customizing the `min`
|
|
1814
|
+
* and `max` multipliers.
|
|
1815
|
+
*
|
|
1816
|
+
* The delay for each step will be adjusted within `min * original_interval` and
|
|
1817
|
+
* `max * original_interval`. If `min` and `max` are not provided, the defaults
|
|
1818
|
+
* are `0.8` and `1.2`, respectively.
|
|
1819
|
+
*
|
|
1820
|
+
* This is useful for introducing randomness into scheduling behavior while
|
|
1821
|
+
* having precise control over the jitter range.
|
|
942
1822
|
*
|
|
943
1823
|
* @since 2.0.0
|
|
944
|
-
* @category
|
|
1824
|
+
* @category Timing & Delay
|
|
945
1825
|
*/
|
|
946
1826
|
(options: {
|
|
947
1827
|
min?: number | undefined;
|
|
948
1828
|
max?: number | undefined;
|
|
949
1829
|
}): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
950
1830
|
/**
|
|
951
|
-
* Returns a new schedule that randomly
|
|
952
|
-
*
|
|
1831
|
+
* Returns a new schedule that randomly adjusts the interval size within a
|
|
1832
|
+
* user-defined range.
|
|
1833
|
+
*
|
|
1834
|
+
* **Details**
|
|
953
1835
|
*
|
|
954
|
-
*
|
|
955
|
-
*
|
|
1836
|
+
* This function modifies a schedule so that its delay between executions is
|
|
1837
|
+
* randomly varied within a specified range. Instead of using the default `0.8 -
|
|
1838
|
+
* 1.2` range like {@link jittered}, this function allows customizing the `min`
|
|
1839
|
+
* and `max` multipliers.
|
|
1840
|
+
*
|
|
1841
|
+
* The delay for each step will be adjusted within `min * original_interval` and
|
|
1842
|
+
* `max * original_interval`. If `min` and `max` are not provided, the defaults
|
|
1843
|
+
* are `0.8` and `1.2`, respectively.
|
|
1844
|
+
*
|
|
1845
|
+
* This is useful for introducing randomness into scheduling behavior while
|
|
1846
|
+
* having precise control over the jitter range.
|
|
956
1847
|
*
|
|
957
1848
|
* @since 2.0.0
|
|
958
|
-
* @category
|
|
1849
|
+
* @category Timing & Delay
|
|
959
1850
|
*/
|
|
960
1851
|
<Out, In, R>(self: Schedule<Out, In, R>, options: {
|
|
961
1852
|
min?: number | undefined;
|
|
@@ -963,781 +1854,1551 @@ export declare const jitteredWith: {
|
|
|
963
1854
|
}): Schedule<Out, In, R>;
|
|
964
1855
|
};
|
|
965
1856
|
/**
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
*
|
|
1857
|
+
* Creates a schedule that recurs indefinitely, increasing the delay linearly.
|
|
1858
|
+
*
|
|
1859
|
+
* **Details**
|
|
1860
|
+
*
|
|
1861
|
+
* This schedule starts with an initial delay of `base` and increases the delay
|
|
1862
|
+
* on each recurrence in a linear fashion, following the formula:
|
|
1863
|
+
*
|
|
1864
|
+
* `delay = base * n`
|
|
1865
|
+
*
|
|
1866
|
+
* where `n` is the number of times the schedule has executed so far. This
|
|
1867
|
+
* results in increasing intervals between executions.
|
|
1868
|
+
*
|
|
1869
|
+
* This is useful for implementing linear backoff strategies where the wait time
|
|
1870
|
+
* between retries increases at a steady rate.
|
|
969
1871
|
*
|
|
970
1872
|
* @since 2.0.0
|
|
971
|
-
* @category
|
|
1873
|
+
* @category Constructors
|
|
972
1874
|
*/
|
|
973
1875
|
export declare const linear: (base: Duration.DurationInput) => Schedule<Duration.Duration>;
|
|
974
1876
|
/**
|
|
975
|
-
* Returns a new schedule that
|
|
976
|
-
*
|
|
1877
|
+
* Returns a new schedule that transforms its output using the specified
|
|
1878
|
+
* function.
|
|
1879
|
+
*
|
|
1880
|
+
* **Details**
|
|
1881
|
+
*
|
|
1882
|
+
* This function modifies an existing schedule so that its outputs are
|
|
1883
|
+
* transformed by the provided function `f`. The timing and recurrence behavior
|
|
1884
|
+
* of the schedule remain unchanged, but the values it produces are mapped to
|
|
1885
|
+
* new values.
|
|
1886
|
+
*
|
|
1887
|
+
* This is useful when composing schedules where you need to adjust the output
|
|
1888
|
+
* format or apply additional processing.
|
|
1889
|
+
*
|
|
1890
|
+
* @see {@link mapEffect} If you need to use an effectful transformation
|
|
1891
|
+
* function.
|
|
977
1892
|
*
|
|
978
1893
|
* @since 2.0.0
|
|
979
|
-
* @category
|
|
1894
|
+
* @category Mapping
|
|
980
1895
|
*/
|
|
981
1896
|
export declare const map: {
|
|
982
1897
|
/**
|
|
983
|
-
* Returns a new schedule that
|
|
984
|
-
*
|
|
1898
|
+
* Returns a new schedule that transforms its output using the specified
|
|
1899
|
+
* function.
|
|
1900
|
+
*
|
|
1901
|
+
* **Details**
|
|
1902
|
+
*
|
|
1903
|
+
* This function modifies an existing schedule so that its outputs are
|
|
1904
|
+
* transformed by the provided function `f`. The timing and recurrence behavior
|
|
1905
|
+
* of the schedule remain unchanged, but the values it produces are mapped to
|
|
1906
|
+
* new values.
|
|
1907
|
+
*
|
|
1908
|
+
* This is useful when composing schedules where you need to adjust the output
|
|
1909
|
+
* format or apply additional processing.
|
|
1910
|
+
*
|
|
1911
|
+
* @see {@link mapEffect} If you need to use an effectful transformation
|
|
1912
|
+
* function.
|
|
985
1913
|
*
|
|
986
1914
|
* @since 2.0.0
|
|
987
|
-
* @category
|
|
1915
|
+
* @category Mapping
|
|
988
1916
|
*/
|
|
989
1917
|
<Out, Out2>(f: (out: Out) => Out2): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out2, In, R>;
|
|
990
1918
|
/**
|
|
991
|
-
* Returns a new schedule that
|
|
992
|
-
*
|
|
1919
|
+
* Returns a new schedule that transforms its output using the specified
|
|
1920
|
+
* function.
|
|
1921
|
+
*
|
|
1922
|
+
* **Details**
|
|
1923
|
+
*
|
|
1924
|
+
* This function modifies an existing schedule so that its outputs are
|
|
1925
|
+
* transformed by the provided function `f`. The timing and recurrence behavior
|
|
1926
|
+
* of the schedule remain unchanged, but the values it produces are mapped to
|
|
1927
|
+
* new values.
|
|
1928
|
+
*
|
|
1929
|
+
* This is useful when composing schedules where you need to adjust the output
|
|
1930
|
+
* format or apply additional processing.
|
|
1931
|
+
*
|
|
1932
|
+
* @see {@link mapEffect} If you need to use an effectful transformation
|
|
1933
|
+
* function.
|
|
993
1934
|
*
|
|
994
1935
|
* @since 2.0.0
|
|
995
|
-
* @category
|
|
1936
|
+
* @category Mapping
|
|
996
1937
|
*/
|
|
997
1938
|
<Out, In, R, Out2>(self: Schedule<Out, In, R>, f: (out: Out) => Out2): Schedule<Out2, In, R>;
|
|
998
1939
|
};
|
|
999
1940
|
/**
|
|
1000
|
-
* Returns a new schedule that
|
|
1001
|
-
*
|
|
1941
|
+
* Returns a new schedule that applies an effectful transformation to its
|
|
1942
|
+
* output.
|
|
1943
|
+
*
|
|
1944
|
+
* **Details**
|
|
1945
|
+
*
|
|
1946
|
+
* This function modifies an existing schedule by applying an effectful function
|
|
1947
|
+
* `f` to its output values. The timing and recurrence behavior of the schedule
|
|
1948
|
+
* remain unchanged, but each output is mapped to a new value within an
|
|
1949
|
+
* `Effect`.
|
|
1950
|
+
*
|
|
1951
|
+
* This is useful when you need to perform side effects or asynchronous
|
|
1952
|
+
* transformations before passing the output forward.
|
|
1953
|
+
*
|
|
1954
|
+
* @see {@link map} If you need to use a pure transformation function.
|
|
1002
1955
|
*
|
|
1003
1956
|
* @since 2.0.0
|
|
1004
|
-
* @category
|
|
1957
|
+
* @category Mapping
|
|
1005
1958
|
*/
|
|
1006
1959
|
export declare const mapEffect: {
|
|
1007
1960
|
/**
|
|
1008
|
-
* Returns a new schedule that
|
|
1009
|
-
*
|
|
1961
|
+
* Returns a new schedule that applies an effectful transformation to its
|
|
1962
|
+
* output.
|
|
1963
|
+
*
|
|
1964
|
+
* **Details**
|
|
1965
|
+
*
|
|
1966
|
+
* This function modifies an existing schedule by applying an effectful function
|
|
1967
|
+
* `f` to its output values. The timing and recurrence behavior of the schedule
|
|
1968
|
+
* remain unchanged, but each output is mapped to a new value within an
|
|
1969
|
+
* `Effect`.
|
|
1970
|
+
*
|
|
1971
|
+
* This is useful when you need to perform side effects or asynchronous
|
|
1972
|
+
* transformations before passing the output forward.
|
|
1973
|
+
*
|
|
1974
|
+
* @see {@link map} If you need to use a pure transformation function.
|
|
1010
1975
|
*
|
|
1011
1976
|
* @since 2.0.0
|
|
1012
|
-
* @category
|
|
1977
|
+
* @category Mapping
|
|
1013
1978
|
*/
|
|
1014
1979
|
<Out, Out2, R2>(f: (out: Out) => Effect.Effect<Out2, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out2, In, R2 | R>;
|
|
1015
1980
|
/**
|
|
1016
|
-
* Returns a new schedule that
|
|
1017
|
-
*
|
|
1981
|
+
* Returns a new schedule that applies an effectful transformation to its
|
|
1982
|
+
* output.
|
|
1983
|
+
*
|
|
1984
|
+
* **Details**
|
|
1985
|
+
*
|
|
1986
|
+
* This function modifies an existing schedule by applying an effectful function
|
|
1987
|
+
* `f` to its output values. The timing and recurrence behavior of the schedule
|
|
1988
|
+
* remain unchanged, but each output is mapped to a new value within an
|
|
1989
|
+
* `Effect`.
|
|
1990
|
+
*
|
|
1991
|
+
* This is useful when you need to perform side effects or asynchronous
|
|
1992
|
+
* transformations before passing the output forward.
|
|
1993
|
+
*
|
|
1994
|
+
* @see {@link map} If you need to use a pure transformation function.
|
|
1018
1995
|
*
|
|
1019
1996
|
* @since 2.0.0
|
|
1020
|
-
* @category
|
|
1997
|
+
* @category Mapping
|
|
1021
1998
|
*/
|
|
1022
1999
|
<Out, In, R, Out2, R2>(self: Schedule<Out, In, R>, f: (out: Out) => Effect.Effect<Out2, never, R2>): Schedule<Out2, In, R | R2>;
|
|
1023
2000
|
};
|
|
1024
2001
|
/**
|
|
1025
|
-
*
|
|
1026
|
-
*
|
|
1027
|
-
* 2.
|
|
2002
|
+
* Returns a new schedule that modifies the delay between executions using a
|
|
2003
|
+
* custom function.
|
|
1028
2004
|
*
|
|
1029
|
-
*
|
|
2005
|
+
* **Details**
|
|
1030
2006
|
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
*
|
|
1037
|
-
* function.
|
|
2007
|
+
* This function transforms an existing schedule by applying `f` to modify the
|
|
2008
|
+
* delay before each execution. The function receives both the schedule's output
|
|
2009
|
+
* (`out`) and the originally computed delay (`duration`), and returns a new
|
|
2010
|
+
* adjusted delay.
|
|
2011
|
+
*
|
|
2012
|
+
* @see {@link modifyDelayEffect} If you need to use an effectful function.
|
|
1038
2013
|
*
|
|
1039
2014
|
* @since 2.0.0
|
|
1040
|
-
* @category
|
|
2015
|
+
* @category Timing & Delay
|
|
1041
2016
|
*/
|
|
1042
2017
|
export declare const modifyDelay: {
|
|
1043
2018
|
/**
|
|
1044
|
-
* Returns a new schedule that modifies the delay using
|
|
1045
|
-
* function.
|
|
2019
|
+
* Returns a new schedule that modifies the delay between executions using a
|
|
2020
|
+
* custom function.
|
|
2021
|
+
*
|
|
2022
|
+
* **Details**
|
|
2023
|
+
*
|
|
2024
|
+
* This function transforms an existing schedule by applying `f` to modify the
|
|
2025
|
+
* delay before each execution. The function receives both the schedule's output
|
|
2026
|
+
* (`out`) and the originally computed delay (`duration`), and returns a new
|
|
2027
|
+
* adjusted delay.
|
|
2028
|
+
*
|
|
2029
|
+
* @see {@link modifyDelayEffect} If you need to use an effectful function.
|
|
1046
2030
|
*
|
|
1047
2031
|
* @since 2.0.0
|
|
1048
|
-
* @category
|
|
2032
|
+
* @category Timing & Delay
|
|
1049
2033
|
*/
|
|
1050
2034
|
<Out>(f: (out: Out, duration: Duration.Duration) => Duration.DurationInput): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1051
2035
|
/**
|
|
1052
|
-
* Returns a new schedule that modifies the delay using
|
|
1053
|
-
* function.
|
|
2036
|
+
* Returns a new schedule that modifies the delay between executions using a
|
|
2037
|
+
* custom function.
|
|
2038
|
+
*
|
|
2039
|
+
* **Details**
|
|
2040
|
+
*
|
|
2041
|
+
* This function transforms an existing schedule by applying `f` to modify the
|
|
2042
|
+
* delay before each execution. The function receives both the schedule's output
|
|
2043
|
+
* (`out`) and the originally computed delay (`duration`), and returns a new
|
|
2044
|
+
* adjusted delay.
|
|
2045
|
+
*
|
|
2046
|
+
* @see {@link modifyDelayEffect} If you need to use an effectful function.
|
|
1054
2047
|
*
|
|
1055
2048
|
* @since 2.0.0
|
|
1056
|
-
* @category
|
|
2049
|
+
* @category Timing & Delay
|
|
1057
2050
|
*/
|
|
1058
2051
|
<Out, In, R>(self: Schedule<Out, In, R>, f: (out: Out, duration: Duration.Duration) => Duration.DurationInput): Schedule<Out, In, R>;
|
|
1059
2052
|
};
|
|
1060
2053
|
/**
|
|
1061
|
-
* Returns a new schedule that modifies the delay using
|
|
1062
|
-
*
|
|
2054
|
+
* Returns a new schedule that modifies the delay before execution using an
|
|
2055
|
+
* effectful function.
|
|
2056
|
+
*
|
|
2057
|
+
* **Details**
|
|
2058
|
+
*
|
|
2059
|
+
* This function takes an existing schedule and applies an effectful function
|
|
2060
|
+
* `f` to dynamically adjust the delay before each execution. The function
|
|
2061
|
+
* receives both the schedule's output (`out`) and the originally computed delay
|
|
2062
|
+
* (`duration`), returning a new adjusted delay wrapped in an `Effect`.
|
|
2063
|
+
*
|
|
2064
|
+
* @see {@link modifyDelay} If you need to use a pure function.
|
|
1063
2065
|
*
|
|
1064
2066
|
* @since 2.0.0
|
|
1065
|
-
* @category
|
|
2067
|
+
* @category Timing & Delay
|
|
1066
2068
|
*/
|
|
1067
2069
|
export declare const modifyDelayEffect: {
|
|
1068
2070
|
/**
|
|
1069
|
-
* Returns a new schedule that modifies the delay using
|
|
1070
|
-
*
|
|
2071
|
+
* Returns a new schedule that modifies the delay before execution using an
|
|
2072
|
+
* effectful function.
|
|
2073
|
+
*
|
|
2074
|
+
* **Details**
|
|
2075
|
+
*
|
|
2076
|
+
* This function takes an existing schedule and applies an effectful function
|
|
2077
|
+
* `f` to dynamically adjust the delay before each execution. The function
|
|
2078
|
+
* receives both the schedule's output (`out`) and the originally computed delay
|
|
2079
|
+
* (`duration`), returning a new adjusted delay wrapped in an `Effect`.
|
|
2080
|
+
*
|
|
2081
|
+
* @see {@link modifyDelay} If you need to use a pure function.
|
|
1071
2082
|
*
|
|
1072
2083
|
* @since 2.0.0
|
|
1073
|
-
* @category
|
|
2084
|
+
* @category Timing & Delay
|
|
1074
2085
|
*/
|
|
1075
2086
|
<Out, R2>(f: (out: Out, duration: Duration.Duration) => Effect.Effect<Duration.DurationInput, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
1076
2087
|
/**
|
|
1077
|
-
* Returns a new schedule that modifies the delay using
|
|
1078
|
-
*
|
|
2088
|
+
* Returns a new schedule that modifies the delay before execution using an
|
|
2089
|
+
* effectful function.
|
|
2090
|
+
*
|
|
2091
|
+
* **Details**
|
|
2092
|
+
*
|
|
2093
|
+
* This function takes an existing schedule and applies an effectful function
|
|
2094
|
+
* `f` to dynamically adjust the delay before each execution. The function
|
|
2095
|
+
* receives both the schedule's output (`out`) and the originally computed delay
|
|
2096
|
+
* (`duration`), returning a new adjusted delay wrapped in an `Effect`.
|
|
2097
|
+
*
|
|
2098
|
+
* @see {@link modifyDelay} If you need to use a pure function.
|
|
1079
2099
|
*
|
|
1080
2100
|
* @since 2.0.0
|
|
1081
|
-
* @category
|
|
2101
|
+
* @category Timing & Delay
|
|
1082
2102
|
*/
|
|
1083
2103
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, f: (out: Out, duration: Duration.Duration) => Effect.Effect<Duration.DurationInput, never, R2>): Schedule<Out, In, R | R2>;
|
|
1084
2104
|
};
|
|
1085
2105
|
/**
|
|
1086
|
-
* Returns a new schedule that
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
2106
|
+
* Returns a new schedule that executes an effect every time the schedule makes
|
|
2107
|
+
* a decision.
|
|
2108
|
+
*
|
|
2109
|
+
* **Details**
|
|
2110
|
+
*
|
|
2111
|
+
* This function enhances an existing schedule by running an effectful function
|
|
2112
|
+
* `f` whenever a scheduling decision is made. The function receives the current
|
|
2113
|
+
* schedule output (`out`) and the decision (`ScheduleDecision`), allowing
|
|
2114
|
+
* additional logic to be executed, such as logging, monitoring, or side
|
|
2115
|
+
* effects.
|
|
1089
2116
|
*
|
|
1090
2117
|
* @since 2.0.0
|
|
1091
|
-
* @category utils
|
|
1092
2118
|
*/
|
|
1093
2119
|
export declare const onDecision: {
|
|
1094
2120
|
/**
|
|
1095
|
-
* Returns a new schedule that
|
|
1096
|
-
*
|
|
1097
|
-
*
|
|
2121
|
+
* Returns a new schedule that executes an effect every time the schedule makes
|
|
2122
|
+
* a decision.
|
|
2123
|
+
*
|
|
2124
|
+
* **Details**
|
|
2125
|
+
*
|
|
2126
|
+
* This function enhances an existing schedule by running an effectful function
|
|
2127
|
+
* `f` whenever a scheduling decision is made. The function receives the current
|
|
2128
|
+
* schedule output (`out`) and the decision (`ScheduleDecision`), allowing
|
|
2129
|
+
* additional logic to be executed, such as logging, monitoring, or side
|
|
2130
|
+
* effects.
|
|
1098
2131
|
*
|
|
1099
2132
|
* @since 2.0.0
|
|
1100
|
-
* @category utils
|
|
1101
2133
|
*/
|
|
1102
2134
|
<Out, X, R2>(f: (out: Out, decision: ScheduleDecision.ScheduleDecision) => Effect.Effect<X, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
1103
2135
|
/**
|
|
1104
|
-
* Returns a new schedule that
|
|
1105
|
-
*
|
|
1106
|
-
*
|
|
2136
|
+
* Returns a new schedule that executes an effect every time the schedule makes
|
|
2137
|
+
* a decision.
|
|
2138
|
+
*
|
|
2139
|
+
* **Details**
|
|
2140
|
+
*
|
|
2141
|
+
* This function enhances an existing schedule by running an effectful function
|
|
2142
|
+
* `f` whenever a scheduling decision is made. The function receives the current
|
|
2143
|
+
* schedule output (`out`) and the decision (`ScheduleDecision`), allowing
|
|
2144
|
+
* additional logic to be executed, such as logging, monitoring, or side
|
|
2145
|
+
* effects.
|
|
1107
2146
|
*
|
|
1108
2147
|
* @since 2.0.0
|
|
1109
|
-
* @category utils
|
|
1110
2148
|
*/
|
|
1111
2149
|
<Out, In, R, X, R2>(self: Schedule<Out, In, R>, f: (out: Out, decision: ScheduleDecision.ScheduleDecision) => Effect.Effect<X, never, R2>): Schedule<Out, In, R | R2>;
|
|
1112
2150
|
};
|
|
1113
2151
|
/**
|
|
1114
|
-
* A schedule that
|
|
2152
|
+
* A schedule that executes only once and then stops.
|
|
2153
|
+
*
|
|
2154
|
+
* **Details**
|
|
2155
|
+
*
|
|
2156
|
+
* This schedule triggers a single execution and then terminates. It does not
|
|
2157
|
+
* repeat or apply any additional logic.
|
|
1115
2158
|
*
|
|
1116
2159
|
* @since 2.0.0
|
|
1117
|
-
* @category
|
|
2160
|
+
* @category Constructors
|
|
1118
2161
|
*/
|
|
1119
2162
|
export declare const once: Schedule<void>;
|
|
1120
2163
|
/**
|
|
1121
|
-
* Returns a new schedule
|
|
2164
|
+
* Returns a new schedule with a provided context, eliminating the need for
|
|
2165
|
+
* external dependencies.
|
|
1122
2166
|
*
|
|
1123
|
-
*
|
|
1124
|
-
*
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
2167
|
+
* **Details**
|
|
2168
|
+
*
|
|
2169
|
+
* This function supplies a required `context` to a schedule, allowing it to run
|
|
2170
|
+
* without requiring external dependencies. After calling this function, the
|
|
2171
|
+
* schedule can be used freely without needing to pass a context at execution
|
|
2172
|
+
* time.
|
|
2173
|
+
*
|
|
2174
|
+
* This is useful when working with schedules that rely on contextual
|
|
2175
|
+
* information, such as logging services, database connections, or configuration
|
|
2176
|
+
* settings.
|
|
1130
2177
|
*
|
|
1131
2178
|
* @since 2.0.0
|
|
1132
|
-
* @category
|
|
2179
|
+
* @category Context
|
|
1133
2180
|
*/
|
|
1134
2181
|
export declare const provideContext: {
|
|
1135
2182
|
/**
|
|
1136
|
-
* Returns a new schedule with
|
|
1137
|
-
*
|
|
2183
|
+
* Returns a new schedule with a provided context, eliminating the need for
|
|
2184
|
+
* external dependencies.
|
|
2185
|
+
*
|
|
2186
|
+
* **Details**
|
|
2187
|
+
*
|
|
2188
|
+
* This function supplies a required `context` to a schedule, allowing it to run
|
|
2189
|
+
* without requiring external dependencies. After calling this function, the
|
|
2190
|
+
* schedule can be used freely without needing to pass a context at execution
|
|
2191
|
+
* time.
|
|
2192
|
+
*
|
|
2193
|
+
* This is useful when working with schedules that rely on contextual
|
|
2194
|
+
* information, such as logging services, database connections, or configuration
|
|
2195
|
+
* settings.
|
|
1138
2196
|
*
|
|
1139
2197
|
* @since 2.0.0
|
|
1140
|
-
* @category
|
|
2198
|
+
* @category Context
|
|
1141
2199
|
*/
|
|
1142
2200
|
<R>(context: Context.Context<R>): <Out, In>(self: Schedule<Out, In, R>) => Schedule<Out, In, never>;
|
|
1143
2201
|
/**
|
|
1144
|
-
* Returns a new schedule with
|
|
1145
|
-
*
|
|
2202
|
+
* Returns a new schedule with a provided context, eliminating the need for
|
|
2203
|
+
* external dependencies.
|
|
2204
|
+
*
|
|
2205
|
+
* **Details**
|
|
2206
|
+
*
|
|
2207
|
+
* This function supplies a required `context` to a schedule, allowing it to run
|
|
2208
|
+
* without requiring external dependencies. After calling this function, the
|
|
2209
|
+
* schedule can be used freely without needing to pass a context at execution
|
|
2210
|
+
* time.
|
|
2211
|
+
*
|
|
2212
|
+
* This is useful when working with schedules that rely on contextual
|
|
2213
|
+
* information, such as logging services, database connections, or configuration
|
|
2214
|
+
* settings.
|
|
1146
2215
|
*
|
|
1147
2216
|
* @since 2.0.0
|
|
1148
|
-
* @category
|
|
2217
|
+
* @category Context
|
|
1149
2218
|
*/
|
|
1150
2219
|
<Out, In, R>(self: Schedule<Out, In, R>, context: Context.Context<R>): Schedule<Out, In, never>;
|
|
1151
2220
|
};
|
|
1152
2221
|
/**
|
|
1153
|
-
* Returns a new schedule with
|
|
1154
|
-
*
|
|
1155
|
-
*
|
|
2222
|
+
* Returns a new schedule with a single required service provided, eliminating
|
|
2223
|
+
* the need for external dependencies.
|
|
2224
|
+
*
|
|
2225
|
+
* **Details**
|
|
2226
|
+
*
|
|
2227
|
+
* This function supplies a single service dependency to a schedule, allowing it
|
|
2228
|
+
* to run without requiring that service externally. If a schedule depends on
|
|
2229
|
+
* multiple services, consider using `provideContext` instead.
|
|
2230
|
+
*
|
|
2231
|
+
* This is useful when working with schedules that require a specific service,
|
|
2232
|
+
* such as logging, metrics, or configuration retrieval.
|
|
1156
2233
|
*
|
|
1157
2234
|
* @since 2.0.0
|
|
1158
|
-
* @category
|
|
2235
|
+
* @category Context
|
|
1159
2236
|
*/
|
|
1160
2237
|
export declare const provideService: {
|
|
1161
2238
|
/**
|
|
1162
|
-
* Returns a new schedule with
|
|
1163
|
-
*
|
|
1164
|
-
*
|
|
2239
|
+
* Returns a new schedule with a single required service provided, eliminating
|
|
2240
|
+
* the need for external dependencies.
|
|
2241
|
+
*
|
|
2242
|
+
* **Details**
|
|
2243
|
+
*
|
|
2244
|
+
* This function supplies a single service dependency to a schedule, allowing it
|
|
2245
|
+
* to run without requiring that service externally. If a schedule depends on
|
|
2246
|
+
* multiple services, consider using `provideContext` instead.
|
|
2247
|
+
*
|
|
2248
|
+
* This is useful when working with schedules that require a specific service,
|
|
2249
|
+
* such as logging, metrics, or configuration retrieval.
|
|
1165
2250
|
*
|
|
1166
2251
|
* @since 2.0.0
|
|
1167
|
-
* @category
|
|
2252
|
+
* @category Context
|
|
1168
2253
|
*/
|
|
1169
|
-
<
|
|
2254
|
+
<I, S>(tag: Context.Tag<I, S>, service: Types.NoInfer<S>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, Exclude<R, I>>;
|
|
1170
2255
|
/**
|
|
1171
|
-
* Returns a new schedule with
|
|
1172
|
-
*
|
|
1173
|
-
*
|
|
2256
|
+
* Returns a new schedule with a single required service provided, eliminating
|
|
2257
|
+
* the need for external dependencies.
|
|
2258
|
+
*
|
|
2259
|
+
* **Details**
|
|
2260
|
+
*
|
|
2261
|
+
* This function supplies a single service dependency to a schedule, allowing it
|
|
2262
|
+
* to run without requiring that service externally. If a schedule depends on
|
|
2263
|
+
* multiple services, consider using `provideContext` instead.
|
|
2264
|
+
*
|
|
2265
|
+
* This is useful when working with schedules that require a specific service,
|
|
2266
|
+
* such as logging, metrics, or configuration retrieval.
|
|
1174
2267
|
*
|
|
1175
2268
|
* @since 2.0.0
|
|
1176
|
-
* @category
|
|
2269
|
+
* @category Context
|
|
1177
2270
|
*/
|
|
1178
|
-
<Out, In, R,
|
|
2271
|
+
<Out, In, R, I, S>(self: Schedule<Out, In, R>, tag: Context.Tag<I, S>, service: Types.NoInfer<S>): Schedule<Out, In, Exclude<R, I>>;
|
|
1179
2272
|
};
|
|
1180
2273
|
/**
|
|
1181
|
-
* A schedule that recurs
|
|
2274
|
+
* A schedule that recurs until the given predicate evaluates to true.
|
|
2275
|
+
*
|
|
2276
|
+
* **Details**
|
|
2277
|
+
*
|
|
2278
|
+
* This schedule will continue executing as long as the provided predicate `f`
|
|
2279
|
+
* returns `false` for the input value. Once `f` evaluates to `true`, the
|
|
2280
|
+
* schedule stops recurring.
|
|
2281
|
+
*
|
|
2282
|
+
* This is useful for defining schedules that should stop when a certain
|
|
2283
|
+
* condition is met, such as detecting a success state, reaching a threshold, or
|
|
2284
|
+
* avoiding unnecessary retries.
|
|
2285
|
+
*
|
|
2286
|
+
* @see {@link recurUntilEffect} If you need to use an effectful predicate.
|
|
1182
2287
|
*
|
|
1183
2288
|
* @since 2.0.0
|
|
1184
|
-
* @category
|
|
2289
|
+
* @category Recurrence Conditions
|
|
1185
2290
|
*/
|
|
1186
2291
|
export declare const recurUntil: <A>(f: Predicate<A>) => Schedule<A, A>;
|
|
1187
2292
|
/**
|
|
1188
|
-
* A schedule that recurs
|
|
2293
|
+
* A schedule that recurs until the given effectful predicate evaluates to true.
|
|
2294
|
+
*
|
|
2295
|
+
* **Details**
|
|
2296
|
+
*
|
|
2297
|
+
* This schedule continues executing as long as the provided effectful predicate
|
|
2298
|
+
* `f` returns `false`. Once `f` evaluates to `true`, the schedule stops
|
|
2299
|
+
* recurring. Unlike {@link recurUntil}, this function allows the stopping
|
|
2300
|
+
* condition to be computed asynchronously or based on external dependencies.
|
|
2301
|
+
*
|
|
2302
|
+
* This is useful when the stopping condition depends on an effectful
|
|
2303
|
+
* computation, such as checking a database, making an API call, or retrieving
|
|
2304
|
+
* system state dynamically.
|
|
2305
|
+
*
|
|
2306
|
+
* @see {@link recurUntil} If you need to use a pure predicate.
|
|
1189
2307
|
*
|
|
1190
2308
|
* @since 2.0.0
|
|
1191
|
-
* @category
|
|
2309
|
+
* @category Recurrence Conditions
|
|
1192
2310
|
*/
|
|
1193
2311
|
export declare const recurUntilEffect: <A, R>(f: (a: A) => Effect.Effect<boolean, never, R>) => Schedule<A, A, R>;
|
|
1194
2312
|
/**
|
|
1195
|
-
* A schedule that recurs
|
|
1196
|
-
*
|
|
2313
|
+
* A schedule that recurs until the input value matches a partial function, then
|
|
2314
|
+
* maps the value.
|
|
2315
|
+
*
|
|
2316
|
+
* **Details**
|
|
2317
|
+
*
|
|
2318
|
+
* This schedule continues executing until the provided partial function `pf`
|
|
2319
|
+
* returns `Some(value)`. At that point, it stops and maps the resulting value
|
|
2320
|
+
* to an `Option<B>`. If `pf` returns `None`, the schedule continues.
|
|
2321
|
+
*
|
|
2322
|
+
* This is useful when defining schedules that should stop once a certain
|
|
2323
|
+
* condition is met and transform the final value before completion.
|
|
1197
2324
|
*
|
|
1198
2325
|
* @since 2.0.0
|
|
1199
|
-
* @category
|
|
2326
|
+
* @category Recurrence Conditions
|
|
1200
2327
|
*/
|
|
1201
2328
|
export declare const recurUntilOption: <A, B>(pf: (a: A) => Option.Option<B>) => Schedule<Option.Option<B>, A>;
|
|
1202
2329
|
/**
|
|
1203
|
-
* A schedule that recurs
|
|
2330
|
+
* A schedule that recurs until the specified duration has elapsed.
|
|
2331
|
+
*
|
|
2332
|
+
* **Details**
|
|
2333
|
+
*
|
|
2334
|
+
* This schedule continues executing for the given `duration`, after which it
|
|
2335
|
+
* stops. The schedule outputs the elapsed time on each recurrence.
|
|
2336
|
+
*
|
|
2337
|
+
* This is useful for limiting the duration of retries, enforcing time-based
|
|
2338
|
+
* constraints, or ensuring that an operation does not run indefinitely.
|
|
1204
2339
|
*
|
|
1205
2340
|
* @since 2.0.0
|
|
1206
|
-
* @category
|
|
2341
|
+
* @category Recurrence Conditions
|
|
1207
2342
|
*/
|
|
1208
2343
|
export declare const recurUpTo: (duration: Duration.DurationInput) => Schedule<Duration.Duration>;
|
|
1209
2344
|
/**
|
|
1210
|
-
* A schedule that recurs
|
|
2345
|
+
* A schedule that recurs as long as the given predicate evaluates to true.
|
|
2346
|
+
*
|
|
2347
|
+
* **Details*
|
|
2348
|
+
*
|
|
2349
|
+
* This schedule continues executing as long as the provided predicate `f`
|
|
2350
|
+
* returns `true` for the input value. Once `f` evaluates to `false`, the
|
|
2351
|
+
* schedule stops recurring.
|
|
2352
|
+
*
|
|
2353
|
+
* @see {@link recurWhileEffect} If you need to use an effectful predicate.
|
|
1211
2354
|
*
|
|
1212
2355
|
* @since 2.0.0
|
|
1213
|
-
* @category
|
|
2356
|
+
* @category Recurrence Conditions
|
|
1214
2357
|
*/
|
|
1215
2358
|
export declare const recurWhile: <A>(f: Predicate<A>) => Schedule<A, A>;
|
|
1216
2359
|
/**
|
|
1217
|
-
* A schedule that recurs
|
|
2360
|
+
* A schedule that recurs as long as the given effectful predicate evaluates to
|
|
1218
2361
|
* true.
|
|
1219
2362
|
*
|
|
2363
|
+
* **Details**
|
|
2364
|
+
*
|
|
2365
|
+
* This schedule continues executing as long as the provided effectful predicate
|
|
2366
|
+
* `f` returns `true`. Once `f` evaluates to `false`, the schedule stops
|
|
2367
|
+
* recurring. Unlike {@link recurWhile}, this function allows the condition to
|
|
2368
|
+
* be computed dynamically using an effectful computation.
|
|
2369
|
+
*
|
|
2370
|
+
* @see {@link recurWhile} If you need to use a pure predicate.
|
|
2371
|
+
*
|
|
1220
2372
|
* @since 2.0.0
|
|
1221
|
-
* @category
|
|
2373
|
+
* @category Recurrence Conditions
|
|
1222
2374
|
*/
|
|
1223
2375
|
export declare const recurWhileEffect: <A, R>(f: (a: A) => Effect.Effect<boolean, never, R>) => Schedule<A, A, R>;
|
|
1224
2376
|
/**
|
|
1225
|
-
* A schedule
|
|
1226
|
-
*
|
|
2377
|
+
* A schedule that recurs a fixed number of times before terminating.
|
|
2378
|
+
*
|
|
2379
|
+
* **Details**
|
|
1227
2380
|
*
|
|
1228
|
-
*
|
|
2381
|
+
* This schedule will continue executing until it has been stepped `n` times,
|
|
2382
|
+
* after which it will stop. The output of the schedule is the current count of
|
|
2383
|
+
* recurrences.
|
|
2384
|
+
*
|
|
2385
|
+
* @category Constructors
|
|
1229
2386
|
* @since 2.0.0
|
|
1230
2387
|
*/
|
|
1231
2388
|
export declare const recurs: (n: number) => Schedule<number>;
|
|
1232
2389
|
/**
|
|
1233
2390
|
* Returns a new schedule that folds over the outputs of this one.
|
|
1234
2391
|
*
|
|
2392
|
+
* **Details**
|
|
2393
|
+
*
|
|
2394
|
+
* This schedule transforms the output by accumulating values over time using a
|
|
2395
|
+
* reducer function `f`. It starts with an initial value `zero` and updates it
|
|
2396
|
+
* each time the schedule produces an output.
|
|
2397
|
+
*
|
|
2398
|
+
* This is useful for tracking statistics, aggregating results, or summarizing
|
|
2399
|
+
* data across multiple executions.
|
|
2400
|
+
*
|
|
2401
|
+
* @see {@link reduceEffect} If you need to use an effectful reducer function.
|
|
2402
|
+
*
|
|
1235
2403
|
* @since 2.0.0
|
|
1236
|
-
* @category
|
|
2404
|
+
* @category Reducing
|
|
1237
2405
|
*/
|
|
1238
2406
|
export declare const reduce: {
|
|
1239
2407
|
/**
|
|
1240
2408
|
* Returns a new schedule that folds over the outputs of this one.
|
|
1241
2409
|
*
|
|
2410
|
+
* **Details**
|
|
2411
|
+
*
|
|
2412
|
+
* This schedule transforms the output by accumulating values over time using a
|
|
2413
|
+
* reducer function `f`. It starts with an initial value `zero` and updates it
|
|
2414
|
+
* each time the schedule produces an output.
|
|
2415
|
+
*
|
|
2416
|
+
* This is useful for tracking statistics, aggregating results, or summarizing
|
|
2417
|
+
* data across multiple executions.
|
|
2418
|
+
*
|
|
2419
|
+
* @see {@link reduceEffect} If you need to use an effectful reducer function.
|
|
2420
|
+
*
|
|
1242
2421
|
* @since 2.0.0
|
|
1243
|
-
* @category
|
|
2422
|
+
* @category Reducing
|
|
1244
2423
|
*/
|
|
1245
2424
|
<Out, Z>(zero: Z, f: (z: Z, out: Out) => Z): <In, R>(self: Schedule<Out, In, R>) => Schedule<Z, In, R>;
|
|
1246
2425
|
/**
|
|
1247
2426
|
* Returns a new schedule that folds over the outputs of this one.
|
|
1248
2427
|
*
|
|
2428
|
+
* **Details**
|
|
2429
|
+
*
|
|
2430
|
+
* This schedule transforms the output by accumulating values over time using a
|
|
2431
|
+
* reducer function `f`. It starts with an initial value `zero` and updates it
|
|
2432
|
+
* each time the schedule produces an output.
|
|
2433
|
+
*
|
|
2434
|
+
* This is useful for tracking statistics, aggregating results, or summarizing
|
|
2435
|
+
* data across multiple executions.
|
|
2436
|
+
*
|
|
2437
|
+
* @see {@link reduceEffect} If you need to use an effectful reducer function.
|
|
2438
|
+
*
|
|
1249
2439
|
* @since 2.0.0
|
|
1250
|
-
* @category
|
|
2440
|
+
* @category Reducing
|
|
1251
2441
|
*/
|
|
1252
2442
|
<Out, In, R, Z>(self: Schedule<Out, In, R>, zero: Z, f: (z: Z, out: Out) => Z): Schedule<Z, In, R>;
|
|
1253
2443
|
};
|
|
1254
2444
|
/**
|
|
1255
2445
|
* Returns a new schedule that effectfully folds over the outputs of this one.
|
|
1256
2446
|
*
|
|
2447
|
+
* **Details**
|
|
2448
|
+
*
|
|
2449
|
+
* This schedule accumulates outputs over time using an effectful reducer
|
|
2450
|
+
* function `f`. It starts with an initial value `zero` and updates it
|
|
2451
|
+
* asynchronously or based on external dependencies.
|
|
2452
|
+
*
|
|
2453
|
+
* This is useful for asynchronous state tracking, logging, external metrics
|
|
2454
|
+
* aggregation, or any scenario where accumulation needs to involve an effectful
|
|
2455
|
+
* computation.
|
|
2456
|
+
*
|
|
2457
|
+
* @see {@link reduce} If you need to use a pure reducer function.
|
|
2458
|
+
*
|
|
1257
2459
|
* @since 2.0.0
|
|
1258
|
-
* @category
|
|
2460
|
+
* @category Reducing
|
|
1259
2461
|
*/
|
|
1260
2462
|
export declare const reduceEffect: {
|
|
1261
2463
|
/**
|
|
1262
2464
|
* Returns a new schedule that effectfully folds over the outputs of this one.
|
|
1263
2465
|
*
|
|
2466
|
+
* **Details**
|
|
2467
|
+
*
|
|
2468
|
+
* This schedule accumulates outputs over time using an effectful reducer
|
|
2469
|
+
* function `f`. It starts with an initial value `zero` and updates it
|
|
2470
|
+
* asynchronously or based on external dependencies.
|
|
2471
|
+
*
|
|
2472
|
+
* This is useful for asynchronous state tracking, logging, external metrics
|
|
2473
|
+
* aggregation, or any scenario where accumulation needs to involve an effectful
|
|
2474
|
+
* computation.
|
|
2475
|
+
*
|
|
2476
|
+
* @see {@link reduce} If you need to use a pure reducer function.
|
|
2477
|
+
*
|
|
1264
2478
|
* @since 2.0.0
|
|
1265
|
-
* @category
|
|
2479
|
+
* @category Reducing
|
|
1266
2480
|
*/
|
|
1267
2481
|
<Z, Out, R2>(zero: Z, f: (z: Z, out: Out) => Effect.Effect<Z, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Z, In, R2 | R>;
|
|
1268
2482
|
/**
|
|
1269
2483
|
* Returns a new schedule that effectfully folds over the outputs of this one.
|
|
1270
2484
|
*
|
|
2485
|
+
* **Details**
|
|
2486
|
+
*
|
|
2487
|
+
* This schedule accumulates outputs over time using an effectful reducer
|
|
2488
|
+
* function `f`. It starts with an initial value `zero` and updates it
|
|
2489
|
+
* asynchronously or based on external dependencies.
|
|
2490
|
+
*
|
|
2491
|
+
* This is useful for asynchronous state tracking, logging, external metrics
|
|
2492
|
+
* aggregation, or any scenario where accumulation needs to involve an effectful
|
|
2493
|
+
* computation.
|
|
2494
|
+
*
|
|
2495
|
+
* @see {@link reduce} If you need to use a pure reducer function.
|
|
2496
|
+
*
|
|
1271
2497
|
* @since 2.0.0
|
|
1272
|
-
* @category
|
|
2498
|
+
* @category Reducing
|
|
1273
2499
|
*/
|
|
1274
2500
|
<Out, In, R, Z, R2>(self: Schedule<Out, In, R>, zero: Z, f: (z: Z, out: Out) => Effect.Effect<Z, never, R2>): Schedule<Z, In, R | R2>;
|
|
1275
2501
|
};
|
|
1276
2502
|
/**
|
|
1277
|
-
*
|
|
1278
|
-
* state when this schedule is done.
|
|
2503
|
+
* Alias of {@link forever}.
|
|
1279
2504
|
*
|
|
1280
2505
|
* @since 2.0.0
|
|
1281
|
-
* @category
|
|
2506
|
+
* @category Constructors
|
|
1282
2507
|
*/
|
|
1283
2508
|
export declare const repeatForever: Schedule<number>;
|
|
1284
2509
|
/**
|
|
1285
2510
|
* Returns a new schedule that outputs the number of repetitions of this one.
|
|
1286
2511
|
*
|
|
2512
|
+
* **Details**
|
|
2513
|
+
*
|
|
2514
|
+
* This schedule tracks how many times the given schedule has executed and
|
|
2515
|
+
* outputs the count instead of the original values. The first execution starts
|
|
2516
|
+
* at `0`, and the count increases with each recurrence.
|
|
2517
|
+
*
|
|
1287
2518
|
* @since 2.0.0
|
|
1288
|
-
* @category
|
|
2519
|
+
* @category Monitoring
|
|
1289
2520
|
*/
|
|
1290
2521
|
export declare const repetitions: <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<number, In, R>;
|
|
1291
2522
|
/**
|
|
1292
|
-
*
|
|
1293
|
-
*
|
|
2523
|
+
* Returns a new schedule that automatically resets to its initial state after a
|
|
2524
|
+
* period of inactivity defined by `duration`.
|
|
2525
|
+
*
|
|
2526
|
+
* **Details**
|
|
2527
|
+
*
|
|
2528
|
+
* This function modifies a schedule so that if no inputs are received for the
|
|
2529
|
+
* specified `duration`, the schedule resets as if it were new.
|
|
2530
|
+
*
|
|
2531
|
+
* @see {@link resetWhen} If you need to reset based on output values.
|
|
1294
2532
|
*
|
|
1295
2533
|
* @since 2.0.0
|
|
1296
|
-
* @category
|
|
2534
|
+
* @category State Management
|
|
1297
2535
|
*/
|
|
1298
2536
|
export declare const resetAfter: {
|
|
1299
2537
|
/**
|
|
1300
|
-
*
|
|
1301
|
-
*
|
|
2538
|
+
* Returns a new schedule that automatically resets to its initial state after a
|
|
2539
|
+
* period of inactivity defined by `duration`.
|
|
2540
|
+
*
|
|
2541
|
+
* **Details**
|
|
2542
|
+
*
|
|
2543
|
+
* This function modifies a schedule so that if no inputs are received for the
|
|
2544
|
+
* specified `duration`, the schedule resets as if it were new.
|
|
2545
|
+
*
|
|
2546
|
+
* @see {@link resetWhen} If you need to reset based on output values.
|
|
1302
2547
|
*
|
|
1303
2548
|
* @since 2.0.0
|
|
1304
|
-
* @category
|
|
2549
|
+
* @category State Management
|
|
1305
2550
|
*/
|
|
1306
2551
|
(duration: Duration.DurationInput): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1307
2552
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
2553
|
+
* Returns a new schedule that automatically resets to its initial state after a
|
|
2554
|
+
* period of inactivity defined by `duration`.
|
|
2555
|
+
*
|
|
2556
|
+
* **Details**
|
|
2557
|
+
*
|
|
2558
|
+
* This function modifies a schedule so that if no inputs are received for the
|
|
2559
|
+
* specified `duration`, the schedule resets as if it were new.
|
|
2560
|
+
*
|
|
2561
|
+
* @see {@link resetWhen} If you need to reset based on output values.
|
|
1310
2562
|
*
|
|
1311
2563
|
* @since 2.0.0
|
|
1312
|
-
* @category
|
|
2564
|
+
* @category State Management
|
|
1313
2565
|
*/
|
|
1314
2566
|
<Out, In, R>(self: Schedule<Out, In, R>, duration: Duration.DurationInput): Schedule<Out, In, R>;
|
|
1315
2567
|
};
|
|
1316
2568
|
/**
|
|
1317
2569
|
* Resets the schedule when the specified predicate on the schedule output
|
|
1318
|
-
* evaluates to true
|
|
2570
|
+
* evaluates to `true`.
|
|
2571
|
+
*
|
|
2572
|
+
* **Details**
|
|
2573
|
+
*
|
|
2574
|
+
* This function modifies a schedule so that it resets to its initial state
|
|
2575
|
+
* whenever the provided predicate `f` returns `true` for an output value.
|
|
2576
|
+
*
|
|
2577
|
+
* @see {@link resetAfter} If you need to reset based on inactivity.
|
|
1319
2578
|
*
|
|
1320
2579
|
* @since 2.0.0
|
|
1321
|
-
* @category
|
|
2580
|
+
* @category State Management
|
|
1322
2581
|
*/
|
|
1323
2582
|
export declare const resetWhen: {
|
|
1324
2583
|
/**
|
|
1325
2584
|
* Resets the schedule when the specified predicate on the schedule output
|
|
1326
|
-
* evaluates to true
|
|
2585
|
+
* evaluates to `true`.
|
|
2586
|
+
*
|
|
2587
|
+
* **Details**
|
|
2588
|
+
*
|
|
2589
|
+
* This function modifies a schedule so that it resets to its initial state
|
|
2590
|
+
* whenever the provided predicate `f` returns `true` for an output value.
|
|
2591
|
+
*
|
|
2592
|
+
* @see {@link resetAfter} If you need to reset based on inactivity.
|
|
1327
2593
|
*
|
|
1328
2594
|
* @since 2.0.0
|
|
1329
|
-
* @category
|
|
2595
|
+
* @category State Management
|
|
1330
2596
|
*/
|
|
1331
2597
|
<Out>(f: Predicate<Out>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1332
2598
|
/**
|
|
1333
2599
|
* Resets the schedule when the specified predicate on the schedule output
|
|
1334
|
-
* evaluates to true
|
|
2600
|
+
* evaluates to `true`.
|
|
2601
|
+
*
|
|
2602
|
+
* **Details**
|
|
2603
|
+
*
|
|
2604
|
+
* This function modifies a schedule so that it resets to its initial state
|
|
2605
|
+
* whenever the provided predicate `f` returns `true` for an output value.
|
|
2606
|
+
*
|
|
2607
|
+
* @see {@link resetAfter} If you need to reset based on inactivity.
|
|
1335
2608
|
*
|
|
1336
2609
|
* @since 2.0.0
|
|
1337
|
-
* @category
|
|
2610
|
+
* @category State Management
|
|
1338
2611
|
*/
|
|
1339
2612
|
<Out, In, R>(self: Schedule<Out, In, R>, f: Predicate<Out>): Schedule<Out, In, R>;
|
|
1340
2613
|
};
|
|
1341
2614
|
/**
|
|
1342
|
-
* Runs a schedule using the provided inputs
|
|
2615
|
+
* Runs a schedule using the provided inputs and collects all outputs.
|
|
2616
|
+
*
|
|
2617
|
+
* **Details**
|
|
2618
|
+
*
|
|
2619
|
+
* This function executes a given schedule with a sequence of input values and
|
|
2620
|
+
* accumulates all outputs into a `Chunk`. The schedule starts execution at the
|
|
2621
|
+
* specified `now` timestamp and proceeds according to its defined behavior.
|
|
2622
|
+
*
|
|
2623
|
+
* This is useful for batch processing, simulating execution, or testing
|
|
2624
|
+
* schedules with predefined input sequences.
|
|
1343
2625
|
*
|
|
1344
2626
|
* @since 2.0.0
|
|
1345
|
-
* @category
|
|
2627
|
+
* @category Execution
|
|
1346
2628
|
*/
|
|
1347
2629
|
export declare const run: {
|
|
1348
2630
|
/**
|
|
1349
|
-
* Runs a schedule using the provided inputs
|
|
2631
|
+
* Runs a schedule using the provided inputs and collects all outputs.
|
|
2632
|
+
*
|
|
2633
|
+
* **Details**
|
|
2634
|
+
*
|
|
2635
|
+
* This function executes a given schedule with a sequence of input values and
|
|
2636
|
+
* accumulates all outputs into a `Chunk`. The schedule starts execution at the
|
|
2637
|
+
* specified `now` timestamp and proceeds according to its defined behavior.
|
|
2638
|
+
*
|
|
2639
|
+
* This is useful for batch processing, simulating execution, or testing
|
|
2640
|
+
* schedules with predefined input sequences.
|
|
1350
2641
|
*
|
|
1351
2642
|
* @since 2.0.0
|
|
1352
|
-
* @category
|
|
2643
|
+
* @category Execution
|
|
1353
2644
|
*/
|
|
1354
2645
|
<In>(now: number, input: Iterable<In>): <Out, R>(self: Schedule<Out, In, R>) => Effect.Effect<Chunk.Chunk<Out>, never, R>;
|
|
1355
2646
|
/**
|
|
1356
|
-
* Runs a schedule using the provided inputs
|
|
2647
|
+
* Runs a schedule using the provided inputs and collects all outputs.
|
|
2648
|
+
*
|
|
2649
|
+
* **Details**
|
|
2650
|
+
*
|
|
2651
|
+
* This function executes a given schedule with a sequence of input values and
|
|
2652
|
+
* accumulates all outputs into a `Chunk`. The schedule starts execution at the
|
|
2653
|
+
* specified `now` timestamp and proceeds according to its defined behavior.
|
|
2654
|
+
*
|
|
2655
|
+
* This is useful for batch processing, simulating execution, or testing
|
|
2656
|
+
* schedules with predefined input sequences.
|
|
1357
2657
|
*
|
|
1358
2658
|
* @since 2.0.0
|
|
1359
|
-
* @category
|
|
2659
|
+
* @category Execution
|
|
1360
2660
|
*/
|
|
1361
2661
|
<Out, In, R>(self: Schedule<Out, In, R>, now: number, input: Iterable<In>): Effect.Effect<Chunk.Chunk<Out>, never, R>;
|
|
1362
2662
|
};
|
|
1363
2663
|
/**
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1366
|
-
* 1, 2.
|
|
2664
|
+
* Returns a schedule that recurs continuously, with each repetition
|
|
2665
|
+
* spaced by the specified `duration` from the last run.
|
|
1367
2666
|
*
|
|
1368
|
-
*
|
|
2667
|
+
* **Details**
|
|
1369
2668
|
*
|
|
1370
|
-
*
|
|
1371
|
-
*
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
* Returns a schedule that recurs continuously, each repetition spaced the
|
|
1376
|
-
* specified duration from the last run.
|
|
2669
|
+
* This schedule ensures that executions occur at a fixed interval,
|
|
2670
|
+
* maintaining a consistent delay between repetitions. The delay starts
|
|
2671
|
+
* from the end of the last execution, not from the schedule start time.
|
|
2672
|
+
*
|
|
2673
|
+
* @see {@link fixed} If you need to run at a fixed interval from the start.
|
|
1377
2674
|
*
|
|
1378
2675
|
* @since 2.0.0
|
|
1379
|
-
* @category
|
|
2676
|
+
* @category Constructors
|
|
1380
2677
|
*/
|
|
1381
2678
|
export declare const spaced: (duration: Duration.DurationInput) => Schedule<number>;
|
|
1382
2679
|
/**
|
|
1383
|
-
* A schedule that does not recur
|
|
2680
|
+
* A schedule that does not recur and stops immediately.
|
|
1384
2681
|
*
|
|
1385
2682
|
* @since 2.0.0
|
|
1386
|
-
* @category
|
|
2683
|
+
* @category Constructors
|
|
1387
2684
|
*/
|
|
1388
2685
|
export declare const stop: Schedule<void>;
|
|
1389
2686
|
/**
|
|
1390
|
-
* Returns a schedule that
|
|
1391
|
-
* value.
|
|
2687
|
+
* Returns a schedule that recurs indefinitely, always producing the specified
|
|
2688
|
+
* constant value.
|
|
1392
2689
|
*
|
|
1393
2690
|
* @since 2.0.0
|
|
1394
|
-
* @category
|
|
2691
|
+
* @category Constructors
|
|
1395
2692
|
*/
|
|
1396
2693
|
export declare const succeed: <A>(value: A) => Schedule<A>;
|
|
1397
2694
|
/**
|
|
1398
|
-
* Returns a schedule that
|
|
1399
|
-
* value.
|
|
2695
|
+
* Returns a schedule that recurs indefinitely, evaluating the given function to
|
|
2696
|
+
* produce a constant value.
|
|
1400
2697
|
*
|
|
1401
|
-
* @category
|
|
2698
|
+
* @category Constructors
|
|
1402
2699
|
* @since 2.0.0
|
|
1403
2700
|
*/
|
|
1404
2701
|
export declare const sync: <A>(evaluate: LazyArg<A>) => Schedule<A>;
|
|
1405
2702
|
/**
|
|
1406
|
-
* Returns a new schedule that
|
|
1407
|
-
*
|
|
2703
|
+
* Returns a new schedule that runs the given effectful function for each input
|
|
2704
|
+
* before continuing execution.
|
|
2705
|
+
*
|
|
2706
|
+
* **Details**
|
|
2707
|
+
*
|
|
2708
|
+
* This function allows side effects to be performed on each input processed by
|
|
2709
|
+
* the schedule. It does not modify the schedule’s behavior but ensures that the
|
|
2710
|
+
* provided function `f` runs before each step.
|
|
1408
2711
|
*
|
|
1409
2712
|
* @since 2.0.0
|
|
1410
|
-
* @category
|
|
2713
|
+
* @category Tapping
|
|
1411
2714
|
*/
|
|
1412
2715
|
export declare const tapInput: {
|
|
1413
2716
|
/**
|
|
1414
|
-
* Returns a new schedule that
|
|
1415
|
-
*
|
|
2717
|
+
* Returns a new schedule that runs the given effectful function for each input
|
|
2718
|
+
* before continuing execution.
|
|
2719
|
+
*
|
|
2720
|
+
* **Details**
|
|
2721
|
+
*
|
|
2722
|
+
* This function allows side effects to be performed on each input processed by
|
|
2723
|
+
* the schedule. It does not modify the schedule’s behavior but ensures that the
|
|
2724
|
+
* provided function `f` runs before each step.
|
|
1416
2725
|
*
|
|
1417
2726
|
* @since 2.0.0
|
|
1418
|
-
* @category
|
|
2727
|
+
* @category Tapping
|
|
1419
2728
|
*/
|
|
1420
2729
|
<In2, X, R2>(f: (input: In2) => Effect.Effect<X, never, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In & In2, R2 | R>;
|
|
1421
2730
|
/**
|
|
1422
|
-
* Returns a new schedule that
|
|
1423
|
-
*
|
|
2731
|
+
* Returns a new schedule that runs the given effectful function for each input
|
|
2732
|
+
* before continuing execution.
|
|
2733
|
+
*
|
|
2734
|
+
* **Details**
|
|
2735
|
+
*
|
|
2736
|
+
* This function allows side effects to be performed on each input processed by
|
|
2737
|
+
* the schedule. It does not modify the schedule’s behavior but ensures that the
|
|
2738
|
+
* provided function `f` runs before each step.
|
|
1424
2739
|
*
|
|
1425
2740
|
* @since 2.0.0
|
|
1426
|
-
* @category
|
|
2741
|
+
* @category Tapping
|
|
1427
2742
|
*/
|
|
1428
2743
|
<Out, In, R, In2, X, R2>(self: Schedule<Out, In, R>, f: (input: In2) => Effect.Effect<X, never, R2>): Schedule<Out, In & In2, R | R2>;
|
|
1429
2744
|
};
|
|
1430
2745
|
/**
|
|
1431
|
-
* Returns a new schedule that
|
|
1432
|
-
*
|
|
2746
|
+
* Returns a new schedule that runs the given effectful function for each output
|
|
2747
|
+
* before continuing execution.
|
|
2748
|
+
*
|
|
2749
|
+
* **Details**
|
|
2750
|
+
*
|
|
2751
|
+
* This function allows side effects to be performed on each output produced by
|
|
2752
|
+
* the schedule. It does not modify the schedule’s behavior but ensures that the
|
|
2753
|
+
* provided function `f` runs after each step.
|
|
1433
2754
|
*
|
|
1434
2755
|
* @since 2.0.0
|
|
1435
|
-
* @category
|
|
2756
|
+
* @category Tapping
|
|
1436
2757
|
*/
|
|
1437
2758
|
export declare const tapOutput: {
|
|
1438
2759
|
/**
|
|
1439
|
-
* Returns a new schedule that
|
|
1440
|
-
*
|
|
2760
|
+
* Returns a new schedule that runs the given effectful function for each output
|
|
2761
|
+
* before continuing execution.
|
|
2762
|
+
*
|
|
2763
|
+
* **Details**
|
|
2764
|
+
*
|
|
2765
|
+
* This function allows side effects to be performed on each output produced by
|
|
2766
|
+
* the schedule. It does not modify the schedule’s behavior but ensures that the
|
|
2767
|
+
* provided function `f` runs after each step.
|
|
1441
2768
|
*
|
|
1442
2769
|
* @since 2.0.0
|
|
1443
|
-
* @category
|
|
2770
|
+
* @category Tapping
|
|
1444
2771
|
*/
|
|
1445
|
-
<
|
|
2772
|
+
<X, R2, Out>(f: (out: Types.NoInfer<Out>) => Effect.Effect<X, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
1446
2773
|
/**
|
|
1447
|
-
* Returns a new schedule that
|
|
1448
|
-
*
|
|
2774
|
+
* Returns a new schedule that runs the given effectful function for each output
|
|
2775
|
+
* before continuing execution.
|
|
2776
|
+
*
|
|
2777
|
+
* **Details**
|
|
2778
|
+
*
|
|
2779
|
+
* This function allows side effects to be performed on each output produced by
|
|
2780
|
+
* the schedule. It does not modify the schedule’s behavior but ensures that the
|
|
2781
|
+
* provided function `f` runs after each step.
|
|
1449
2782
|
*
|
|
1450
2783
|
* @since 2.0.0
|
|
1451
|
-
* @category
|
|
2784
|
+
* @category Tapping
|
|
1452
2785
|
*/
|
|
1453
|
-
<Out, In, R,
|
|
2786
|
+
<Out, In, R, X, R2>(self: Schedule<Out, In, R>, f: (out: Out) => Effect.Effect<X, never, R2>): Schedule<Out, In, R | R2>;
|
|
1454
2787
|
};
|
|
1455
2788
|
/**
|
|
1456
|
-
*
|
|
1457
|
-
*
|
|
2789
|
+
* Creates a schedule that repeatedly applies a function to transform a state
|
|
2790
|
+
* value, producing a sequence of values.
|
|
2791
|
+
*
|
|
2792
|
+
* **Details**
|
|
2793
|
+
*
|
|
2794
|
+
* This function starts with an `initial` value and applies `f` recursively to
|
|
2795
|
+
* generate the next state at each step. The schedule continues indefinitely,
|
|
2796
|
+
* producing a stream of values by unfolding the state over time.
|
|
1458
2797
|
*
|
|
1459
2798
|
* @since 2.0.0
|
|
1460
|
-
* @category
|
|
2799
|
+
* @category Constructors
|
|
1461
2800
|
*/
|
|
1462
2801
|
export declare const unfold: <A>(initial: A, f: (a: A) => A) => Schedule<A>;
|
|
1463
2802
|
/**
|
|
1464
|
-
*
|
|
1465
|
-
*
|
|
2803
|
+
* Combines two schedules, continuing execution as long as at least one of them
|
|
2804
|
+
* allows it, using the shorter delay.
|
|
2805
|
+
*
|
|
2806
|
+
* **Details**
|
|
2807
|
+
*
|
|
2808
|
+
* This function combines two schedules into a single schedule that executes in
|
|
2809
|
+
* parallel. If either schedule allows continuation, the merged schedule
|
|
2810
|
+
* continues. When both schedules produce delays, the schedule selects the
|
|
2811
|
+
* shorter delay to determine the next step.
|
|
2812
|
+
*
|
|
2813
|
+
* The output of the new schedule is a tuple containing the outputs of both
|
|
2814
|
+
* schedules. The input type is the intersection of both schedules' input types.
|
|
2815
|
+
*
|
|
2816
|
+
* This is useful for scenarios where multiple scheduling conditions should be
|
|
2817
|
+
* considered, ensuring execution proceeds if at least one schedule permits it.
|
|
2818
|
+
*
|
|
2819
|
+
* @see {@link unionWith} If you need to use a custom merge function.
|
|
1466
2820
|
*
|
|
1467
2821
|
* @since 2.0.0
|
|
1468
|
-
* @category
|
|
2822
|
+
* @category Composition
|
|
1469
2823
|
*/
|
|
1470
2824
|
export declare const union: {
|
|
1471
2825
|
/**
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
2826
|
+
* Combines two schedules, continuing execution as long as at least one of them
|
|
2827
|
+
* allows it, using the shorter delay.
|
|
2828
|
+
*
|
|
2829
|
+
* **Details**
|
|
2830
|
+
*
|
|
2831
|
+
* This function combines two schedules into a single schedule that executes in
|
|
2832
|
+
* parallel. If either schedule allows continuation, the merged schedule
|
|
2833
|
+
* continues. When both schedules produce delays, the schedule selects the
|
|
2834
|
+
* shorter delay to determine the next step.
|
|
2835
|
+
*
|
|
2836
|
+
* The output of the new schedule is a tuple containing the outputs of both
|
|
2837
|
+
* schedules. The input type is the intersection of both schedules' input types.
|
|
2838
|
+
*
|
|
2839
|
+
* This is useful for scenarios where multiple scheduling conditions should be
|
|
2840
|
+
* considered, ensuring execution proceeds if at least one schedule permits it.
|
|
2841
|
+
*
|
|
2842
|
+
* @see {@link unionWith} If you need to use a custom merge function.
|
|
1474
2843
|
*
|
|
1475
2844
|
* @since 2.0.0
|
|
1476
|
-
* @category
|
|
2845
|
+
* @category Composition
|
|
1477
2846
|
*/
|
|
1478
2847
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<[Out, Out2], In & In2, R2 | R>;
|
|
1479
2848
|
/**
|
|
1480
|
-
*
|
|
1481
|
-
*
|
|
2849
|
+
* Combines two schedules, continuing execution as long as at least one of them
|
|
2850
|
+
* allows it, using the shorter delay.
|
|
2851
|
+
*
|
|
2852
|
+
* **Details**
|
|
2853
|
+
*
|
|
2854
|
+
* This function combines two schedules into a single schedule that executes in
|
|
2855
|
+
* parallel. If either schedule allows continuation, the merged schedule
|
|
2856
|
+
* continues. When both schedules produce delays, the schedule selects the
|
|
2857
|
+
* shorter delay to determine the next step.
|
|
2858
|
+
*
|
|
2859
|
+
* The output of the new schedule is a tuple containing the outputs of both
|
|
2860
|
+
* schedules. The input type is the intersection of both schedules' input types.
|
|
2861
|
+
*
|
|
2862
|
+
* This is useful for scenarios where multiple scheduling conditions should be
|
|
2863
|
+
* considered, ensuring execution proceeds if at least one schedule permits it.
|
|
2864
|
+
*
|
|
2865
|
+
* @see {@link unionWith} If you need to use a custom merge function.
|
|
1482
2866
|
*
|
|
1483
2867
|
* @since 2.0.0
|
|
1484
|
-
* @category
|
|
2868
|
+
* @category Composition
|
|
1485
2869
|
*/
|
|
1486
2870
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<[Out, Out2], In & In2, R | R2>;
|
|
1487
2871
|
};
|
|
1488
2872
|
/**
|
|
1489
|
-
*
|
|
1490
|
-
*
|
|
1491
|
-
*
|
|
2873
|
+
* Combines two schedules, continuing execution as long as at least one of them
|
|
2874
|
+
* wants to continue, merging their intervals using a custom merge function.
|
|
2875
|
+
*
|
|
2876
|
+
* **Details**
|
|
2877
|
+
*
|
|
2878
|
+
* This function allows you to combine two schedules while defining how their
|
|
2879
|
+
* intervals should be merged. Unlike {@link union}, which simply selects the
|
|
2880
|
+
* shorter delay, this function lets you specify a custom merging strategy for
|
|
2881
|
+
* the schedules’ intervals.
|
|
2882
|
+
*
|
|
2883
|
+
* The merged schedule continues execution as long as at least one of the input
|
|
2884
|
+
* schedules allows it. The next interval is determined by applying the provided
|
|
2885
|
+
* merge function to the intervals of both schedules.
|
|
2886
|
+
*
|
|
2887
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
2888
|
+
* both schedules. The input type is the intersection of both schedules' input
|
|
2889
|
+
* types.
|
|
2890
|
+
*
|
|
2891
|
+
* @see {@link union} If you need to use the shorter delay.
|
|
1492
2892
|
*
|
|
1493
2893
|
* @since 2.0.0
|
|
1494
|
-
* @category
|
|
2894
|
+
* @category Composition
|
|
1495
2895
|
*/
|
|
1496
2896
|
export declare const unionWith: {
|
|
1497
2897
|
/**
|
|
1498
|
-
*
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
2898
|
+
* Combines two schedules, continuing execution as long as at least one of them
|
|
2899
|
+
* wants to continue, merging their intervals using a custom merge function.
|
|
2900
|
+
*
|
|
2901
|
+
* **Details**
|
|
2902
|
+
*
|
|
2903
|
+
* This function allows you to combine two schedules while defining how their
|
|
2904
|
+
* intervals should be merged. Unlike {@link union}, which simply selects the
|
|
2905
|
+
* shorter delay, this function lets you specify a custom merging strategy for
|
|
2906
|
+
* the schedules’ intervals.
|
|
2907
|
+
*
|
|
2908
|
+
* The merged schedule continues execution as long as at least one of the input
|
|
2909
|
+
* schedules allows it. The next interval is determined by applying the provided
|
|
2910
|
+
* merge function to the intervals of both schedules.
|
|
2911
|
+
*
|
|
2912
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
2913
|
+
* both schedules. The input type is the intersection of both schedules' input
|
|
2914
|
+
* types.
|
|
2915
|
+
*
|
|
2916
|
+
* @see {@link union} If you need to use the shorter delay.
|
|
1501
2917
|
*
|
|
1502
2918
|
* @since 2.0.0
|
|
1503
|
-
* @category
|
|
2919
|
+
* @category Composition
|
|
1504
2920
|
*/
|
|
1505
2921
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>, f: (x: Intervals.Intervals, y: Intervals.Intervals) => Intervals.Intervals): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<[Out, Out2], In & In2, R2 | R>;
|
|
1506
2922
|
/**
|
|
1507
|
-
*
|
|
1508
|
-
*
|
|
1509
|
-
*
|
|
2923
|
+
* Combines two schedules, continuing execution as long as at least one of them
|
|
2924
|
+
* wants to continue, merging their intervals using a custom merge function.
|
|
2925
|
+
*
|
|
2926
|
+
* **Details**
|
|
2927
|
+
*
|
|
2928
|
+
* This function allows you to combine two schedules while defining how their
|
|
2929
|
+
* intervals should be merged. Unlike {@link union}, which simply selects the
|
|
2930
|
+
* shorter delay, this function lets you specify a custom merging strategy for
|
|
2931
|
+
* the schedules’ intervals.
|
|
2932
|
+
*
|
|
2933
|
+
* The merged schedule continues execution as long as at least one of the input
|
|
2934
|
+
* schedules allows it. The next interval is determined by applying the provided
|
|
2935
|
+
* merge function to the intervals of both schedules.
|
|
2936
|
+
*
|
|
2937
|
+
* The output of the resulting schedule is a tuple containing the outputs of
|
|
2938
|
+
* both schedules. The input type is the intersection of both schedules' input
|
|
2939
|
+
* types.
|
|
2940
|
+
*
|
|
2941
|
+
* @see {@link union} If you need to use the shorter delay.
|
|
1510
2942
|
*
|
|
1511
2943
|
* @since 2.0.0
|
|
1512
|
-
* @category
|
|
2944
|
+
* @category Composition
|
|
1513
2945
|
*/
|
|
1514
2946
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>, f: (x: Intervals.Intervals, y: Intervals.Intervals) => Intervals.Intervals): Schedule<[Out, Out2], In & In2, R | R2>;
|
|
1515
2947
|
};
|
|
1516
2948
|
/**
|
|
1517
|
-
* Returns a new schedule that
|
|
1518
|
-
* input evaluates to true
|
|
2949
|
+
* Returns a new schedule that stops execution when the given predicate on the
|
|
2950
|
+
* input evaluates to `true`.
|
|
2951
|
+
*
|
|
2952
|
+
* **Details**
|
|
2953
|
+
*
|
|
2954
|
+
* This function modifies an existing schedule so that it continues executing
|
|
2955
|
+
* only while the provided predicate returns `false` for incoming inputs. Once
|
|
2956
|
+
* an input satisfies the condition, the schedule terminates immediately.
|
|
2957
|
+
*
|
|
2958
|
+
* @see {@link untilInputEffect} If you need to use an effectful predicate.
|
|
1519
2959
|
*
|
|
1520
2960
|
* @since 2.0.0
|
|
1521
|
-
* @category
|
|
2961
|
+
* @category Recurrence Conditions
|
|
1522
2962
|
*/
|
|
1523
2963
|
export declare const untilInput: {
|
|
1524
2964
|
/**
|
|
1525
|
-
* Returns a new schedule that
|
|
1526
|
-
* input evaluates to true
|
|
2965
|
+
* Returns a new schedule that stops execution when the given predicate on the
|
|
2966
|
+
* input evaluates to `true`.
|
|
2967
|
+
*
|
|
2968
|
+
* **Details**
|
|
2969
|
+
*
|
|
2970
|
+
* This function modifies an existing schedule so that it continues executing
|
|
2971
|
+
* only while the provided predicate returns `false` for incoming inputs. Once
|
|
2972
|
+
* an input satisfies the condition, the schedule terminates immediately.
|
|
2973
|
+
*
|
|
2974
|
+
* @see {@link untilInputEffect} If you need to use an effectful predicate.
|
|
1527
2975
|
*
|
|
1528
2976
|
* @since 2.0.0
|
|
1529
|
-
* @category
|
|
2977
|
+
* @category Recurrence Conditions
|
|
1530
2978
|
*/
|
|
1531
2979
|
<In>(f: Predicate<In>): <Out, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1532
2980
|
/**
|
|
1533
|
-
* Returns a new schedule that
|
|
1534
|
-
* input evaluates to true
|
|
2981
|
+
* Returns a new schedule that stops execution when the given predicate on the
|
|
2982
|
+
* input evaluates to `true`.
|
|
2983
|
+
*
|
|
2984
|
+
* **Details**
|
|
2985
|
+
*
|
|
2986
|
+
* This function modifies an existing schedule so that it continues executing
|
|
2987
|
+
* only while the provided predicate returns `false` for incoming inputs. Once
|
|
2988
|
+
* an input satisfies the condition, the schedule terminates immediately.
|
|
2989
|
+
*
|
|
2990
|
+
* @see {@link untilInputEffect} If you need to use an effectful predicate.
|
|
1535
2991
|
*
|
|
1536
2992
|
* @since 2.0.0
|
|
1537
|
-
* @category
|
|
2993
|
+
* @category Recurrence Conditions
|
|
1538
2994
|
*/
|
|
1539
2995
|
<Out, In, R>(self: Schedule<Out, In, R>, f: Predicate<In>): Schedule<Out, In, R>;
|
|
1540
2996
|
};
|
|
1541
2997
|
/**
|
|
1542
|
-
* Returns a new schedule that
|
|
1543
|
-
* predicate on the input evaluates to true
|
|
2998
|
+
* Returns a new schedule that stops execution when the given effectful
|
|
2999
|
+
* predicate on the input evaluates to `true`.
|
|
3000
|
+
*
|
|
3001
|
+
* **Details**
|
|
3002
|
+
*
|
|
3003
|
+
* This function modifies an existing schedule so that it continues executing
|
|
3004
|
+
* only while the provided effectful predicate returns `false` for incoming
|
|
3005
|
+
* inputs. The predicate is an `Effect`, meaning it can involve asynchronous
|
|
3006
|
+
* computations or dependency-based logic.
|
|
3007
|
+
*
|
|
3008
|
+
* @see {@link untilInput} If you need to use a pure predicate.
|
|
1544
3009
|
*
|
|
1545
3010
|
* @since 2.0.0
|
|
1546
|
-
* @category
|
|
3011
|
+
* @category Recurrence Conditions
|
|
1547
3012
|
*/
|
|
1548
3013
|
export declare const untilInputEffect: {
|
|
1549
3014
|
/**
|
|
1550
|
-
* Returns a new schedule that
|
|
1551
|
-
* predicate on the input evaluates to true
|
|
3015
|
+
* Returns a new schedule that stops execution when the given effectful
|
|
3016
|
+
* predicate on the input evaluates to `true`.
|
|
3017
|
+
*
|
|
3018
|
+
* **Details**
|
|
3019
|
+
*
|
|
3020
|
+
* This function modifies an existing schedule so that it continues executing
|
|
3021
|
+
* only while the provided effectful predicate returns `false` for incoming
|
|
3022
|
+
* inputs. The predicate is an `Effect`, meaning it can involve asynchronous
|
|
3023
|
+
* computations or dependency-based logic.
|
|
3024
|
+
*
|
|
3025
|
+
* @see {@link untilInput} If you need to use a pure predicate.
|
|
1552
3026
|
*
|
|
1553
3027
|
* @since 2.0.0
|
|
1554
|
-
* @category
|
|
3028
|
+
* @category Recurrence Conditions
|
|
1555
3029
|
*/
|
|
1556
3030
|
<In, R2>(f: (input: In) => Effect.Effect<boolean, never, R2>): <Out, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
1557
3031
|
/**
|
|
1558
|
-
* Returns a new schedule that
|
|
1559
|
-
* predicate on the input evaluates to true
|
|
3032
|
+
* Returns a new schedule that stops execution when the given effectful
|
|
3033
|
+
* predicate on the input evaluates to `true`.
|
|
3034
|
+
*
|
|
3035
|
+
* **Details**
|
|
3036
|
+
*
|
|
3037
|
+
* This function modifies an existing schedule so that it continues executing
|
|
3038
|
+
* only while the provided effectful predicate returns `false` for incoming
|
|
3039
|
+
* inputs. The predicate is an `Effect`, meaning it can involve asynchronous
|
|
3040
|
+
* computations or dependency-based logic.
|
|
3041
|
+
*
|
|
3042
|
+
* @see {@link untilInput} If you need to use a pure predicate.
|
|
1560
3043
|
*
|
|
1561
3044
|
* @since 2.0.0
|
|
1562
|
-
* @category
|
|
3045
|
+
* @category Recurrence Conditions
|
|
1563
3046
|
*/
|
|
1564
3047
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, f: (input: In) => Effect.Effect<boolean, never, R2>): Schedule<Out, In, R | R2>;
|
|
1565
3048
|
};
|
|
1566
3049
|
/**
|
|
1567
|
-
* Returns a new schedule that
|
|
1568
|
-
* output evaluates to true
|
|
3050
|
+
* Returns a new schedule that stops execution when the given predicate on the
|
|
3051
|
+
* output evaluates to `true`.
|
|
3052
|
+
*
|
|
3053
|
+
* **Details**
|
|
3054
|
+
*
|
|
3055
|
+
* This function modifies an existing schedule so that it only continues
|
|
3056
|
+
* executing while the given predicate returns false for its output values. Once
|
|
3057
|
+
* the predicate evaluates to `true`, execution stops.
|
|
3058
|
+
*
|
|
3059
|
+
* The output of the resulting schedule remains the same, but its duration is
|
|
3060
|
+
* now constrained by a stopping condition based on its own output.
|
|
3061
|
+
*
|
|
3062
|
+
* @see {@link untilOutputEffect} If you need to use an effectful predicate.
|
|
1569
3063
|
*
|
|
1570
3064
|
* @since 2.0.0
|
|
1571
|
-
* @category
|
|
3065
|
+
* @category Recurrence Conditions
|
|
1572
3066
|
*/
|
|
1573
3067
|
export declare const untilOutput: {
|
|
1574
3068
|
/**
|
|
1575
|
-
* Returns a new schedule that
|
|
1576
|
-
* output evaluates to true
|
|
3069
|
+
* Returns a new schedule that stops execution when the given predicate on the
|
|
3070
|
+
* output evaluates to `true`.
|
|
3071
|
+
*
|
|
3072
|
+
* **Details**
|
|
3073
|
+
*
|
|
3074
|
+
* This function modifies an existing schedule so that it only continues
|
|
3075
|
+
* executing while the given predicate returns false for its output values. Once
|
|
3076
|
+
* the predicate evaluates to `true`, execution stops.
|
|
3077
|
+
*
|
|
3078
|
+
* The output of the resulting schedule remains the same, but its duration is
|
|
3079
|
+
* now constrained by a stopping condition based on its own output.
|
|
3080
|
+
*
|
|
3081
|
+
* @see {@link untilOutputEffect} If you need to use an effectful predicate.
|
|
1577
3082
|
*
|
|
1578
3083
|
* @since 2.0.0
|
|
1579
|
-
* @category
|
|
3084
|
+
* @category Recurrence Conditions
|
|
1580
3085
|
*/
|
|
1581
3086
|
<Out>(f: Predicate<Out>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1582
3087
|
/**
|
|
1583
|
-
* Returns a new schedule that
|
|
1584
|
-
* output evaluates to true
|
|
3088
|
+
* Returns a new schedule that stops execution when the given predicate on the
|
|
3089
|
+
* output evaluates to `true`.
|
|
3090
|
+
*
|
|
3091
|
+
* **Details**
|
|
3092
|
+
*
|
|
3093
|
+
* This function modifies an existing schedule so that it only continues
|
|
3094
|
+
* executing while the given predicate returns false for its output values. Once
|
|
3095
|
+
* the predicate evaluates to `true`, execution stops.
|
|
3096
|
+
*
|
|
3097
|
+
* The output of the resulting schedule remains the same, but its duration is
|
|
3098
|
+
* now constrained by a stopping condition based on its own output.
|
|
3099
|
+
*
|
|
3100
|
+
* @see {@link untilOutputEffect} If you need to use an effectful predicate.
|
|
1585
3101
|
*
|
|
1586
3102
|
* @since 2.0.0
|
|
1587
|
-
* @category
|
|
3103
|
+
* @category Recurrence Conditions
|
|
1588
3104
|
*/
|
|
1589
3105
|
<Out, In, R>(self: Schedule<Out, In, R>, f: Predicate<Out>): Schedule<Out, In, R>;
|
|
1590
3106
|
};
|
|
1591
3107
|
/**
|
|
1592
|
-
* Returns a new schedule that
|
|
1593
|
-
* predicate on the output evaluates to true
|
|
3108
|
+
* Returns a new schedule that stops execution when the given effectful
|
|
3109
|
+
* predicate on the output evaluates to `true`.
|
|
3110
|
+
*
|
|
3111
|
+
* **Details**
|
|
3112
|
+
*
|
|
3113
|
+
* This function modifies an existing schedule so that it only continues
|
|
3114
|
+
* executing while the provided effectful predicate returns `false` for its
|
|
3115
|
+
* output values. Once the predicate returns `true`, execution stops.
|
|
3116
|
+
*
|
|
3117
|
+
* @see {@link untilOutput} If you need to use a pure predicate.
|
|
1594
3118
|
*
|
|
1595
3119
|
* @since 2.0.0
|
|
1596
|
-
* @category
|
|
3120
|
+
* @category Recurrence Conditions
|
|
1597
3121
|
*/
|
|
1598
3122
|
export declare const untilOutputEffect: {
|
|
1599
3123
|
/**
|
|
1600
|
-
* Returns a new schedule that
|
|
1601
|
-
* predicate on the output evaluates to true
|
|
3124
|
+
* Returns a new schedule that stops execution when the given effectful
|
|
3125
|
+
* predicate on the output evaluates to `true`.
|
|
3126
|
+
*
|
|
3127
|
+
* **Details**
|
|
3128
|
+
*
|
|
3129
|
+
* This function modifies an existing schedule so that it only continues
|
|
3130
|
+
* executing while the provided effectful predicate returns `false` for its
|
|
3131
|
+
* output values. Once the predicate returns `true`, execution stops.
|
|
3132
|
+
*
|
|
3133
|
+
* @see {@link untilOutput} If you need to use a pure predicate.
|
|
1602
3134
|
*
|
|
1603
3135
|
* @since 2.0.0
|
|
1604
|
-
* @category
|
|
3136
|
+
* @category Recurrence Conditions
|
|
1605
3137
|
*/
|
|
1606
3138
|
<Out, R2>(f: (out: Out) => Effect.Effect<boolean, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
1607
3139
|
/**
|
|
1608
|
-
* Returns a new schedule that
|
|
1609
|
-
* predicate on the output evaluates to true
|
|
3140
|
+
* Returns a new schedule that stops execution when the given effectful
|
|
3141
|
+
* predicate on the output evaluates to `true`.
|
|
3142
|
+
*
|
|
3143
|
+
* **Details**
|
|
3144
|
+
*
|
|
3145
|
+
* This function modifies an existing schedule so that it only continues
|
|
3146
|
+
* executing while the provided effectful predicate returns `false` for its
|
|
3147
|
+
* output values. Once the predicate returns `true`, execution stops.
|
|
3148
|
+
*
|
|
3149
|
+
* @see {@link untilOutput} If you need to use a pure predicate.
|
|
1610
3150
|
*
|
|
1611
3151
|
* @since 2.0.0
|
|
1612
|
-
* @category
|
|
3152
|
+
* @category Recurrence Conditions
|
|
1613
3153
|
*/
|
|
1614
3154
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, f: (out: Out) => Effect.Effect<boolean, never, R2>): Schedule<Out, In, R | R2>;
|
|
1615
3155
|
};
|
|
1616
3156
|
/**
|
|
1617
|
-
*
|
|
3157
|
+
* Returns a new schedule that limits execution to a fixed duration.
|
|
3158
|
+
*
|
|
3159
|
+
* **Details**
|
|
3160
|
+
*
|
|
3161
|
+
* This function modifies an existing schedule to stop execution after a
|
|
3162
|
+
* specified duration has passed. The schedule continues as normal until the
|
|
3163
|
+
* duration is reached, at which point it stops automatically.
|
|
1618
3164
|
*
|
|
1619
3165
|
* @since 2.0.0
|
|
1620
|
-
* @category
|
|
3166
|
+
* @category Recurrence Conditions
|
|
1621
3167
|
*/
|
|
1622
3168
|
export declare const upTo: {
|
|
1623
3169
|
/**
|
|
1624
|
-
*
|
|
3170
|
+
* Returns a new schedule that limits execution to a fixed duration.
|
|
3171
|
+
*
|
|
3172
|
+
* **Details**
|
|
3173
|
+
*
|
|
3174
|
+
* This function modifies an existing schedule to stop execution after a
|
|
3175
|
+
* specified duration has passed. The schedule continues as normal until the
|
|
3176
|
+
* duration is reached, at which point it stops automatically.
|
|
1625
3177
|
*
|
|
1626
3178
|
* @since 2.0.0
|
|
1627
|
-
* @category
|
|
3179
|
+
* @category Recurrence Conditions
|
|
1628
3180
|
*/
|
|
1629
3181
|
(duration: Duration.DurationInput): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1630
3182
|
/**
|
|
1631
|
-
*
|
|
3183
|
+
* Returns a new schedule that limits execution to a fixed duration.
|
|
3184
|
+
*
|
|
3185
|
+
* **Details**
|
|
3186
|
+
*
|
|
3187
|
+
* This function modifies an existing schedule to stop execution after a
|
|
3188
|
+
* specified duration has passed. The schedule continues as normal until the
|
|
3189
|
+
* duration is reached, at which point it stops automatically.
|
|
1632
3190
|
*
|
|
1633
3191
|
* @since 2.0.0
|
|
1634
|
-
* @category
|
|
3192
|
+
* @category Recurrence Conditions
|
|
1635
3193
|
*/
|
|
1636
3194
|
<Out, In, R>(self: Schedule<Out, In, R>, duration: Duration.DurationInput): Schedule<Out, In, R>;
|
|
1637
3195
|
};
|
|
1638
3196
|
/**
|
|
1639
|
-
* Returns a new schedule that continues
|
|
1640
|
-
* on the input
|
|
3197
|
+
* Returns a new schedule that continues execution as long as the given
|
|
3198
|
+
* predicate on the input is true.
|
|
3199
|
+
*
|
|
3200
|
+
* **Details**
|
|
3201
|
+
*
|
|
3202
|
+
* This function modifies an existing schedule so that it only continues
|
|
3203
|
+
* execution while a specified predicate holds true for its input. If the
|
|
3204
|
+
* predicate evaluates to `false` at any step, the schedule stops.
|
|
3205
|
+
*
|
|
3206
|
+
* @see {@link whileInputEffect} If you need to use an effectful predicate.
|
|
1641
3207
|
*
|
|
1642
3208
|
* @since 2.0.0
|
|
1643
|
-
* @category
|
|
3209
|
+
* @category Recurrence Conditions
|
|
1644
3210
|
*/
|
|
1645
3211
|
export declare const whileInput: {
|
|
1646
3212
|
/**
|
|
1647
|
-
* Returns a new schedule that continues
|
|
1648
|
-
* on the input
|
|
3213
|
+
* Returns a new schedule that continues execution as long as the given
|
|
3214
|
+
* predicate on the input is true.
|
|
3215
|
+
*
|
|
3216
|
+
* **Details**
|
|
3217
|
+
*
|
|
3218
|
+
* This function modifies an existing schedule so that it only continues
|
|
3219
|
+
* execution while a specified predicate holds true for its input. If the
|
|
3220
|
+
* predicate evaluates to `false` at any step, the schedule stops.
|
|
3221
|
+
*
|
|
3222
|
+
* @see {@link whileInputEffect} If you need to use an effectful predicate.
|
|
1649
3223
|
*
|
|
1650
3224
|
* @since 2.0.0
|
|
1651
|
-
* @category
|
|
3225
|
+
* @category Recurrence Conditions
|
|
1652
3226
|
*/
|
|
1653
3227
|
<In>(f: Predicate<In>): <Out, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1654
3228
|
/**
|
|
1655
|
-
* Returns a new schedule that continues
|
|
1656
|
-
* on the input
|
|
3229
|
+
* Returns a new schedule that continues execution as long as the given
|
|
3230
|
+
* predicate on the input is true.
|
|
3231
|
+
*
|
|
3232
|
+
* **Details**
|
|
3233
|
+
*
|
|
3234
|
+
* This function modifies an existing schedule so that it only continues
|
|
3235
|
+
* execution while a specified predicate holds true for its input. If the
|
|
3236
|
+
* predicate evaluates to `false` at any step, the schedule stops.
|
|
3237
|
+
*
|
|
3238
|
+
* @see {@link whileInputEffect} If you need to use an effectful predicate.
|
|
1657
3239
|
*
|
|
1658
3240
|
* @since 2.0.0
|
|
1659
|
-
* @category
|
|
3241
|
+
* @category Recurrence Conditions
|
|
1660
3242
|
*/
|
|
1661
3243
|
<Out, In, R>(self: Schedule<Out, In, R>, f: Predicate<In>): Schedule<Out, In, R>;
|
|
1662
3244
|
};
|
|
1663
3245
|
/**
|
|
1664
|
-
* Returns a new schedule that continues for as long as the
|
|
1665
|
-
* predicate on the input evaluates to true
|
|
3246
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3247
|
+
* effectful predicate on the input evaluates to `true`.
|
|
3248
|
+
*
|
|
3249
|
+
* **Details**
|
|
3250
|
+
*
|
|
3251
|
+
* This function modifies an existing schedule so that it only continues
|
|
3252
|
+
* execution while an effectful predicate holds true for its input. If the
|
|
3253
|
+
* predicate evaluates to `false` at any step, the schedule stops.
|
|
3254
|
+
*
|
|
3255
|
+
* @see {@link whileInput} If you need to use a pure predicate.
|
|
1666
3256
|
*
|
|
1667
3257
|
* @since 2.0.0
|
|
1668
|
-
* @category
|
|
3258
|
+
* @category Recurrence Conditions
|
|
1669
3259
|
*/
|
|
1670
3260
|
export declare const whileInputEffect: {
|
|
1671
3261
|
/**
|
|
1672
|
-
* Returns a new schedule that continues for as long as the
|
|
1673
|
-
* predicate on the input evaluates to true
|
|
3262
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3263
|
+
* effectful predicate on the input evaluates to `true`.
|
|
3264
|
+
*
|
|
3265
|
+
* **Details**
|
|
3266
|
+
*
|
|
3267
|
+
* This function modifies an existing schedule so that it only continues
|
|
3268
|
+
* execution while an effectful predicate holds true for its input. If the
|
|
3269
|
+
* predicate evaluates to `false` at any step, the schedule stops.
|
|
3270
|
+
*
|
|
3271
|
+
* @see {@link whileInput} If you need to use a pure predicate.
|
|
1674
3272
|
*
|
|
1675
3273
|
* @since 2.0.0
|
|
1676
|
-
* @category
|
|
3274
|
+
* @category Recurrence Conditions
|
|
1677
3275
|
*/
|
|
1678
3276
|
<In, R2>(f: (input: In) => Effect.Effect<boolean, never, R2>): <Out, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
1679
3277
|
/**
|
|
1680
|
-
* Returns a new schedule that continues for as long as the
|
|
1681
|
-
* predicate on the input evaluates to true
|
|
3278
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3279
|
+
* effectful predicate on the input evaluates to `true`.
|
|
3280
|
+
*
|
|
3281
|
+
* **Details**
|
|
3282
|
+
*
|
|
3283
|
+
* This function modifies an existing schedule so that it only continues
|
|
3284
|
+
* execution while an effectful predicate holds true for its input. If the
|
|
3285
|
+
* predicate evaluates to `false` at any step, the schedule stops.
|
|
3286
|
+
*
|
|
3287
|
+
* @see {@link whileInput} If you need to use a pure predicate.
|
|
1682
3288
|
*
|
|
1683
3289
|
* @since 2.0.0
|
|
1684
|
-
* @category
|
|
3290
|
+
* @category Recurrence Conditions
|
|
1685
3291
|
*/
|
|
1686
3292
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, f: (input: In) => Effect.Effect<boolean, never, R2>): Schedule<Out, In, R | R2>;
|
|
1687
3293
|
};
|
|
1688
3294
|
/**
|
|
1689
|
-
* Returns a new schedule that continues for as long the
|
|
1690
|
-
* on the output evaluates to true
|
|
3295
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3296
|
+
* predicate on the output evaluates to `true`.
|
|
3297
|
+
*
|
|
3298
|
+
* **Details**
|
|
3299
|
+
*
|
|
3300
|
+
* This function modifies an existing schedule so that it only continues
|
|
3301
|
+
* execution while a provided condition holds true for its output. If the
|
|
3302
|
+
* predicate returns `false`, the schedule stops.
|
|
3303
|
+
*
|
|
3304
|
+
* @see {@link whileOutputEffect} If you need to use an effectful predicate.
|
|
1691
3305
|
*
|
|
1692
3306
|
* @since 2.0.0
|
|
1693
|
-
* @category
|
|
3307
|
+
* @category Recurrence Conditions
|
|
1694
3308
|
*/
|
|
1695
3309
|
export declare const whileOutput: {
|
|
1696
3310
|
/**
|
|
1697
|
-
* Returns a new schedule that continues for as long the
|
|
1698
|
-
* on the output evaluates to true
|
|
3311
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3312
|
+
* predicate on the output evaluates to `true`.
|
|
3313
|
+
*
|
|
3314
|
+
* **Details**
|
|
3315
|
+
*
|
|
3316
|
+
* This function modifies an existing schedule so that it only continues
|
|
3317
|
+
* execution while a provided condition holds true for its output. If the
|
|
3318
|
+
* predicate returns `false`, the schedule stops.
|
|
3319
|
+
*
|
|
3320
|
+
* @see {@link whileOutputEffect} If you need to use an effectful predicate.
|
|
1699
3321
|
*
|
|
1700
3322
|
* @since 2.0.0
|
|
1701
|
-
* @category
|
|
3323
|
+
* @category Recurrence Conditions
|
|
1702
3324
|
*/
|
|
1703
3325
|
<Out>(f: Predicate<Out>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R>;
|
|
1704
3326
|
/**
|
|
1705
|
-
* Returns a new schedule that continues for as long the
|
|
1706
|
-
* on the output evaluates to true
|
|
3327
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3328
|
+
* predicate on the output evaluates to `true`.
|
|
3329
|
+
*
|
|
3330
|
+
* **Details**
|
|
3331
|
+
*
|
|
3332
|
+
* This function modifies an existing schedule so that it only continues
|
|
3333
|
+
* execution while a provided condition holds true for its output. If the
|
|
3334
|
+
* predicate returns `false`, the schedule stops.
|
|
3335
|
+
*
|
|
3336
|
+
* @see {@link whileOutputEffect} If you need to use an effectful predicate.
|
|
1707
3337
|
*
|
|
1708
3338
|
* @since 2.0.0
|
|
1709
|
-
* @category
|
|
3339
|
+
* @category Recurrence Conditions
|
|
1710
3340
|
*/
|
|
1711
3341
|
<Out, In, R>(self: Schedule<Out, In, R>, f: Predicate<Out>): Schedule<Out, In, R>;
|
|
1712
3342
|
};
|
|
1713
3343
|
/**
|
|
1714
|
-
* Returns a new schedule that continues for as long the
|
|
1715
|
-
* predicate on the output evaluates to true
|
|
3344
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3345
|
+
* effectful predicate on the output evaluates to `true`.
|
|
3346
|
+
*
|
|
3347
|
+
* **Details**
|
|
3348
|
+
*
|
|
3349
|
+
* This function modifies an existing schedule so that it only continues
|
|
3350
|
+
* execution while an effectful condition holds true for its output. If the
|
|
3351
|
+
* effectful predicate returns `false`, the schedule stops.
|
|
3352
|
+
*
|
|
3353
|
+
* @see {@link whileOutput} If you need to use a pure predicate.
|
|
1716
3354
|
*
|
|
1717
3355
|
* @since 2.0.0
|
|
1718
|
-
* @category
|
|
3356
|
+
* @category Recurrence Conditions
|
|
1719
3357
|
*/
|
|
1720
3358
|
export declare const whileOutputEffect: {
|
|
1721
3359
|
/**
|
|
1722
|
-
* Returns a new schedule that continues for as long the
|
|
1723
|
-
* predicate on the output evaluates to true
|
|
3360
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3361
|
+
* effectful predicate on the output evaluates to `true`.
|
|
3362
|
+
*
|
|
3363
|
+
* **Details**
|
|
3364
|
+
*
|
|
3365
|
+
* This function modifies an existing schedule so that it only continues
|
|
3366
|
+
* execution while an effectful condition holds true for its output. If the
|
|
3367
|
+
* effectful predicate returns `false`, the schedule stops.
|
|
3368
|
+
*
|
|
3369
|
+
* @see {@link whileOutput} If you need to use a pure predicate.
|
|
1724
3370
|
*
|
|
1725
3371
|
* @since 2.0.0
|
|
1726
|
-
* @category
|
|
3372
|
+
* @category Recurrence Conditions
|
|
1727
3373
|
*/
|
|
1728
3374
|
<Out, R2>(f: (out: Out) => Effect.Effect<boolean, never, R2>): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In, R2 | R>;
|
|
1729
3375
|
/**
|
|
1730
|
-
* Returns a new schedule that continues for as long the
|
|
1731
|
-
* predicate on the output evaluates to true
|
|
3376
|
+
* Returns a new schedule that continues execution for as long as the given
|
|
3377
|
+
* effectful predicate on the output evaluates to `true`.
|
|
3378
|
+
*
|
|
3379
|
+
* **Details**
|
|
3380
|
+
*
|
|
3381
|
+
* This function modifies an existing schedule so that it only continues
|
|
3382
|
+
* execution while an effectful condition holds true for its output. If the
|
|
3383
|
+
* effectful predicate returns `false`, the schedule stops.
|
|
3384
|
+
*
|
|
3385
|
+
* @see {@link whileOutput} If you need to use a pure predicate.
|
|
1732
3386
|
*
|
|
1733
3387
|
* @since 2.0.0
|
|
1734
|
-
* @category
|
|
3388
|
+
* @category Recurrence Conditions
|
|
1735
3389
|
*/
|
|
1736
3390
|
<Out, In, R, R2>(self: Schedule<Out, In, R>, f: (out: Out) => Effect.Effect<boolean, never, R2>): Schedule<Out, In, R | R2>;
|
|
1737
3391
|
};
|
|
1738
3392
|
/**
|
|
1739
|
-
*
|
|
1740
|
-
*
|
|
3393
|
+
* Creates a schedule that divides time into fixed `interval`-long windows,
|
|
3394
|
+
* triggering execution at the start of each new window.
|
|
3395
|
+
*
|
|
3396
|
+
* **Details**
|
|
3397
|
+
*
|
|
3398
|
+
* This function produces a schedule that waits until the next time window
|
|
3399
|
+
* boundary before executing. Each window spans a fixed duration specified by
|
|
3400
|
+
* `interval`. If an action completes midway through a window, the schedule
|
|
3401
|
+
* waits until the next full window starts before proceeding.
|
|
1741
3402
|
*
|
|
1742
3403
|
* For example, `windowed(Duration.seconds(10))` would produce a schedule as
|
|
1743
3404
|
* follows:
|
|
@@ -1749,72 +3410,72 @@ export declare const whileOutputEffect: {
|
|
|
1749
3410
|
* ```
|
|
1750
3411
|
*
|
|
1751
3412
|
* @since 2.0.0
|
|
1752
|
-
* @category
|
|
3413
|
+
* @category Constructors
|
|
1753
3414
|
*/
|
|
1754
3415
|
export declare const windowed: (interval: Duration.DurationInput) => Schedule<number>;
|
|
1755
3416
|
/**
|
|
1756
|
-
* The same as
|
|
3417
|
+
* The same as {@link intersect} but ignores the right output.
|
|
1757
3418
|
*
|
|
1758
3419
|
* @since 2.0.0
|
|
1759
|
-
* @category
|
|
3420
|
+
* @category Composition
|
|
1760
3421
|
*/
|
|
1761
3422
|
export declare const zipLeft: {
|
|
1762
3423
|
/**
|
|
1763
|
-
* The same as
|
|
3424
|
+
* The same as {@link intersect} but ignores the right output.
|
|
1764
3425
|
*
|
|
1765
3426
|
* @since 2.0.0
|
|
1766
|
-
* @category
|
|
3427
|
+
* @category Composition
|
|
1767
3428
|
*/
|
|
1768
3429
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out, In & In2, R2 | R>;
|
|
1769
3430
|
/**
|
|
1770
|
-
* The same as
|
|
3431
|
+
* The same as {@link intersect} but ignores the right output.
|
|
1771
3432
|
*
|
|
1772
3433
|
* @since 2.0.0
|
|
1773
|
-
* @category
|
|
3434
|
+
* @category Composition
|
|
1774
3435
|
*/
|
|
1775
3436
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<Out, In & In2, R | R2>;
|
|
1776
3437
|
};
|
|
1777
3438
|
/**
|
|
1778
|
-
* The same as
|
|
3439
|
+
* The same as {@link intersect} but ignores the left output.
|
|
1779
3440
|
*
|
|
1780
3441
|
* @since 2.0.0
|
|
1781
|
-
* @category
|
|
3442
|
+
* @category Composition
|
|
1782
3443
|
*/
|
|
1783
3444
|
export declare const zipRight: {
|
|
1784
3445
|
/**
|
|
1785
|
-
* The same as
|
|
3446
|
+
* The same as {@link intersect} but ignores the left output.
|
|
1786
3447
|
*
|
|
1787
3448
|
* @since 2.0.0
|
|
1788
|
-
* @category
|
|
3449
|
+
* @category Composition
|
|
1789
3450
|
*/
|
|
1790
3451
|
<Out2, In2, R2>(that: Schedule<Out2, In2, R2>): <Out, In, R>(self: Schedule<Out, In, R>) => Schedule<Out2, In & In2, R2 | R>;
|
|
1791
3452
|
/**
|
|
1792
|
-
* The same as
|
|
3453
|
+
* The same as {@link intersect} but ignores the left output.
|
|
1793
3454
|
*
|
|
1794
3455
|
* @since 2.0.0
|
|
1795
|
-
* @category
|
|
3456
|
+
* @category Composition
|
|
1796
3457
|
*/
|
|
1797
3458
|
<Out, In, R, Out2, In2, R2>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>): Schedule<Out2, In & In2, R | R2>;
|
|
1798
3459
|
};
|
|
1799
3460
|
/**
|
|
1800
|
-
* Equivalent to
|
|
3461
|
+
* Equivalent to {@link intersect} followed by {@link map}.
|
|
1801
3462
|
*
|
|
1802
3463
|
* @since 2.0.0
|
|
1803
|
-
* @category
|
|
3464
|
+
* @category Composition
|
|
1804
3465
|
*/
|
|
1805
3466
|
export declare const zipWith: {
|
|
1806
3467
|
/**
|
|
1807
|
-
* Equivalent to
|
|
3468
|
+
* Equivalent to {@link intersect} followed by {@link map}.
|
|
1808
3469
|
*
|
|
1809
3470
|
* @since 2.0.0
|
|
1810
|
-
* @category
|
|
3471
|
+
* @category Composition
|
|
1811
3472
|
*/
|
|
1812
3473
|
<Out2, In2, R2, Out, Out3>(that: Schedule<Out2, In2, R2>, f: (out: Out, out2: Out2) => Out3): <In, R>(self: Schedule<Out, In, R>) => Schedule<Out3, In & In2, R2 | R>;
|
|
1813
3474
|
/**
|
|
1814
|
-
* Equivalent to
|
|
3475
|
+
* Equivalent to {@link intersect} followed by {@link map}.
|
|
1815
3476
|
*
|
|
1816
3477
|
* @since 2.0.0
|
|
1817
|
-
* @category
|
|
3478
|
+
* @category Composition
|
|
1818
3479
|
*/
|
|
1819
3480
|
<Out, In, R, Out2, In2, R2, Out3>(self: Schedule<Out, In, R>, that: Schedule<Out2, In2, R2>, f: (out: Out, out2: Out2) => Out3): Schedule<Out3, In & In2, R | R2>;
|
|
1820
3481
|
};
|