Class Schedule
- Namespace
- Eon
- Assembly
- Eon.dll
A Schedule is defined as a potentially infinite stream of Duration, combined with mechanisms for composing them.
public abstract record Schedule : IEnumerable<Duration>, IEnumerable, IEquatable<Schedule>
- Inheritance
-
Schedule
- Implements
- Inherited Members
Fields
- NoDelayOnFirst
A ScheduleTransformer that will enforce the first emission from the Schedule is a Zero
- RepeatForever
A ScheduleTransformer which repeats any Schedule forever
Properties
- CanCount
Returns true if the Schedule is finite. False indicates the Schedule is infinite and Count will return null
- Count
Returns the number of Duration emissions the Schedule will emit; or null if the Schedule is infinite. Call CanCount to determine if a non-null count will be returned
- this[int]
Provides
index
based access to a shared enumerated version ofthis
Schedule. This will grow the internal buffer in a synchronized way by doubling the current length of the buffer when it is filled.
Methods
- Between(Duration, Duration)
A Schedule transformer that places a
min
floor andmax
ceiling on the returned delays
- DayOfWeek(DayOfWeek, Func<DateTimeOffset>?)
Cron-like Schedule that recurs every specified
day
of each week
- Decorrelate(double, int?)
Transforms the Schedule by de-correlating each of the Duration both up and down in a jittered way
- Exponential(Duration, double)
Schedule that recurs continuously using a exponential backoff
- Fibonacci(Duration)
Schedule that recurs continuously using a fibonacci based backoff
- Fixed(Duration, Func<DateTimeOffset>?)
Schedule that recurs on a fixed `interval`.
If the action run between updates takes longer than the `interval`, then the action will be run immediately, but re-runs will not "pile up".
|-----interval-----|-----interval-----|-----interval-----| |---------action--------||action|-----|action|-----------|
- From(params Duration[])
Schedule constructor that recurs for the specified
durations
- From(IReadOnlyList<Duration>)
Schedule constructor that recurs for the specified
durations
- GetEnumerator()
Realise the underlying time-series of Duration
- GreaterThan(Duration)
A Schedule transformer that places a
min
floor on the returned delays
- HourOfDay(uint, Func<DateTimeOffset>?)
Cron-like Schedule that recurs every specified
hour
of each day
- Interleave(Schedule)
Interleave an emission from the
other
Schedule between each emission ofthis
Schedule until either Schedule completes
- Intersect(Schedule)
Intersection of two Schedule. As long as both of the two Schedule are still running it will return the maximum Duration
- Intersperse(Schedule)
A ScheduleTransformer that intersperses the provided Schedule`s emissions between each emission in the Schedule
- Jitter(Duration, Duration, int?)
A ScheduleTransformer that adds a random jitter to any returned Duration
- Jitter(double, int?)
A ScheduleTransformer that adds a random jitter to any returned Duration
- LessThan(Duration)
A Schedule transformer that places a
max
ceiling on the returned delays
- Linear(Duration, double)
Schedule that recurs continuously using a linear backoff
- MaxCumulativeDelay(Duration)
A Schedule transformer that places a
max
cumulative ceiling on the returned delays
- MinuteOfHour(uint, Func<DateTimeOffset>?)
Cron-like Schedule that recurs every specified
minute
of each hour
- Recurs(int)
A ScheduleTransformer that limits the schedule to run the specified number of
times
- Repeat(int)
A ScheduleTransformer that repeats the Schedule a given number of
times
- ResetAfter(Duration)
Resets the Schedule after a provided cumulative
max
Duration
- SecondOfMinute(uint, Func<DateTimeOffset>?)
Cron-like Schedule that recurs every specified
second
of each minute
- Select(Func<Duration, Duration>)
Select operation for Schedule which transforms each emitted Duration into a new Duration
- Select(Func<Duration, int, Duration>)
Select operation for Schedule which transforms each emitted Duration and index into a new Duration
- SelectMany(Func<Duration, Schedule>)
Applies the
bind
for each emission fromthis
Schedule which then emits all Duration from that returned Schedule.
- SelectMany(Func<Duration, Schedule>, Func<Duration, Duration, Duration>)
Applies the
bind
for each emission fromthis
Schedule which then emits all Duration from that returned Schedule.projection
is then called for each pair of Duration emitted
- Spaced(Duration)
Schedule that recurs continuously with the given spacing
- Transform(Func<Schedule, Schedule>)
ScheduleTransformer constructor which provides mapping capabilities for Schedule instances
- Union(Schedule)
Union of two Schedule. As long as any of the two Schedule are still running it will return the minimum Duration
- UpTo(Duration, Func<DateTimeOffset>?)
Schedule that will continue to emmit Zero until
max
Duration has passed.
- Where(Func<Duration, bool>)
Applies the
predicate
on each emitted Duration fromthis
Schedule returning only those that pass
- Windowed(Duration, Func<DateTimeOffset>?)
A Schedule that divides the timeline into `interval`-long windows, and sleeps until the nearest window boundary every time it recurs.
For example, 10 second `interval` would produce a schedule as follows:
10s 10s 10s 10s |----------|----------|----------|----------| |action------|sleep---|act|-sleep|action----|
Operators
- operator &(Schedule, ScheduleTransformer)
Intersect(Schedule) of a Schedule and a ScheduleTransformer