Flow control timeline
The same fifteen events arrive in bursts over a minute. Pick a kind of flow control and change its settings to see which runs start at once, which wait, which are skipped and which are merged.
Concurrency
At most a number of runs execute at the same time. Others wait for a free slot and start in order. Concurrency in the Inngest docs.
The numbers
| Event arrives | Outcome | Its run starts |
|---|---|---|
| 0s | started at once | 0s |
| 1s | started at once | 1s |
| 1.5s | delayed | 8s |
| 2s | delayed | 9s |
| 3s | delayed | 16s |
| 4s | delayed | 17s |
| 10s | delayed | 24s |
| 11s | delayed | 25s |
| 12s | delayed | 32s |
| 13s | delayed | 33s |
| 25s | delayed | 40s |
| 26s | delayed | 41s |
| 40s | delayed | 48s |
| 41s | delayed | 49s |
| 42s | delayed | 56s |
Throttle
At most a number of runs start per period. Others are queued and start later, spread out evenly. Throttle in the Inngest docs.
The numbers
| Event arrives | Outcome | Its run starts |
|---|---|---|
| 0s | started at once | 0s |
| 1s | delayed | 3.3s |
| 1.5s | delayed | 6.7s |
| 2s | delayed | 10s |
| 3s | delayed | 13.3s |
| 4s | delayed | 16.7s |
| 10s | delayed | 20s |
| 11s | delayed | 23.3s |
| 12s | delayed | 26.7s |
| 13s | delayed | 30.0s |
| 25s | delayed | 33.3s |
| 26s | delayed | 36.7s |
| 40s | started at once | 40s |
| 41s | delayed | 43.3s |
| 42s | delayed | 46.7s |
Rate limit
At most a number of runs start per period. Events beyond that are skipped and never run. Rate limit in the Inngest docs.
The numbers
| Event arrives | Outcome | Its run starts |
|---|---|---|
| 0s | started at once | 0s |
| 1s | started at once | 1s |
| 1.5s | started at once | 1.5s |
| 2s | skipped | never |
| 3s | skipped | never |
| 4s | started at once | 4s |
| 10s | started at once | 10s |
| 11s | started at once | 11s |
| 12s | skipped | never |
| 13s | skipped | never |
| 25s | started at once | 25s |
| 26s | started at once | 26s |
| 40s | started at once | 40s |
| 41s | started at once | 41s |
| 42s | started at once | 42s |
Debounce
One run starts once events stop arriving for a period, with the last event. A timeout caps the wait. Debounce in the Inngest docs.
The numbers
| Event arrives | Outcome | Its run starts |
|---|---|---|
| 0s | merged into a later run | 9s |
| 1s | merged into a later run | 9s |
| 1.5s | merged into a later run | 9s |
| 2s | merged into a later run | 9s |
| 3s | merged into a later run | 9s |
| 4s | started at once | 9s |
| 10s | merged into a later run | 18s |
| 11s | merged into a later run | 18s |
| 12s | merged into a later run | 18s |
| 13s | started at once | 18s |
| 25s | merged into a later run | 31s |
| 26s | started at once | 31s |
| 40s | merged into a later run | 47s |
| 41s | merged into a later run | 47s |
| 42s | started at once | 47s |
Reading the timeline
Section titled “Reading the timeline”Each dot on the top line is an event. Each bar below is a run, from when it starts to when it ends, and the line from an event leads to the run that handles it. A slanted line means the run started later than its event arrived.
The model is simple on purpose: one key, every run is a single step, and timings are in seconds. Inngest’s scheduler works with more detail, for example concurrency limits steps rather than whole runs, and rate limiting uses the generic cell rate algorithm with the period starting at the first event. Inngest has its own flow control simulator for exact behavior.
In code
Section titled “In code”Each of these is one attribute on the function class, or one property of FunctionOptions:
[Concurrency(2)][Throttle(3, "10s", Burst = 1)][RateLimit(3, "10s")]A debounce takes a period and an optional timeout:
[Debounce("5s", Timeout = "15s")]Concurrency = [new ConcurrencyLimit(2)],Throttle = new Throttle(3, TimeSpan.FromSeconds(10)) { Burst = 1 },RateLimit = new RateLimit(3, TimeSpan.FromSeconds(10)),A debounce takes a period and an optional timeout:
Debounce = new Debounce(TimeSpan.FromSeconds(5)) { Timeout = TimeSpan.FromSeconds(15) },Flow control covers every option, including keys that give each customer a limit of its own.
inngest-dotnet is a community Inngest SDK for .NET. It is not affiliated with or endorsed by Inngest Inc.