ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
flow_control.c
Go to the documentation of this file.
2
4 uint64_t now_ns, uint64_t delay_ns) {
5 if (!debounce)
6 return;
7 debounce->due_ns =
8 UINT64_MAX - now_ns < delay_ns ? UINT64_MAX : now_ns + delay_ns;
9 debounce->pending = true;
10}
11
13 uint64_t now_ns) {
14 if (!debounce || !debounce->pending || now_ns < debounce->due_ns)
15 return false;
16 debounce->pending = false;
17 return true;
18}
19
21 if (!debounce)
22 return;
23 debounce->pending = false;
24 debounce->due_ns = 0;
25}
void flow_control_debounce_cancel(flow_control_debounce_t *debounce)
void flow_control_debounce_trigger(flow_control_debounce_t *debounce, uint64_t now_ns, uint64_t delay_ns)
Definition flow_control.c:3
bool flow_control_debounce_take_ready(flow_control_debounce_t *debounce, uint64_t now_ns)
unsigned long long uint64_t