Skip to content

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.

Flow control

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.

Settings
Timeline of events and runs15 events, 15 runs, 13 delayed by up to 20s.eventsruns0s10s20s30s40s50s60s70s
15 events, 15 runs, 13 delayed by up to 20s.started at oncedelayedskippedmerged into a later run
The numbers
Event arrivesOutcomeIts run starts
0sstarted at once0s
1sstarted at once1s
1.5sdelayed8s
2sdelayed9s
3sdelayed16s
4sdelayed17s
10sdelayed24s
11sdelayed25s
12sdelayed32s
13sdelayed33s
25sdelayed40s
26sdelayed41s
40sdelayed48s
41sdelayed49s
42sdelayed56s

Throttle

At most a number of runs start per period. Others are queued and start later, spread out evenly. Throttle in the Inngest docs.

Settings
Timeline of events and runs15 events, 15 runs, 13 delayed by up to 17.0s.eventsruns0s10s20s30s40s50s60s
15 events, 15 runs, 13 delayed by up to 17.0s.started at oncedelayedskippedmerged into a later run
The numbers
Event arrivesOutcomeIts run starts
0sstarted at once0s
1sdelayed3.3s
1.5sdelayed6.7s
2sdelayed10s
3sdelayed13.3s
4sdelayed16.7s
10sdelayed20s
11sdelayed23.3s
12sdelayed26.7s
13sdelayed30.0s
25sdelayed33.3s
26sdelayed36.7s
40sstarted at once40s
41sdelayed43.3s
42sdelayed46.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.

Settings
Timeline of events and runs15 events, 11 runs, 4 skipped.eventsruns0s10s20s30s40s50s60s
15 events, 11 runs, 4 skipped.started at oncedelayedskippedmerged into a later run
The numbers
Event arrivesOutcomeIts run starts
0sstarted at once0s
1sstarted at once1s
1.5sstarted at once1.5s
2sskippednever
3sskippednever
4sstarted at once4s
10sstarted at once10s
11sstarted at once11s
12sskippednever
13sskippednever
25sstarted at once25s
26sstarted at once26s
40sstarted at once40s
41sstarted at once41s
42sstarted at once42s

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.

Settings
Timeline of events and runs15 events, 4 runs, 11 merged into a later event's run.eventsruns0s10s20s30s40s50s60s
15 events, 4 runs, 11 merged into a later event's run.started at oncedelayedskippedmerged into a later run
The numbers
Event arrivesOutcomeIts run starts
0smerged into a later run9s
1smerged into a later run9s
1.5smerged into a later run9s
2smerged into a later run9s
3smerged into a later run9s
4sstarted at once9s
10smerged into a later run18s
11smerged into a later run18s
12smerged into a later run18s
13sstarted at once18s
25smerged into a later run31s
26sstarted at once31s
40smerged into a later run47s
41smerged into a later run47s
42sstarted at once47s

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.

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")]

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.