1#ifndef REACTESP_SRC_EVENT_LOOP_H_
2#define REACTESP_SRC_EVENT_LOOP_H_
Event that is triggered after a certain time delay.
Events are code to be called when a given condition is fulfilled.
Asynchronous event loop supporting timed (repeating and non-repeating), interrupt and stream events.
void remove(TimedEvent *event)
DelayEvent * onDelayMicros(uint64_t delay, react_callback callback)
Create a new DelayEvent.
EventLoop(EventLoop &&)=delete
EventLoop()
Construct a new EventLoop object.
SemaphoreHandle_t untimed_list_mutex_
StreamEvent * onAvailable(Stream &stream, react_callback callback)
Create a new StreamEvent.
TickEvent * onTick(react_callback callback)
Create a new TickEvent.
DelayEvent * onDelay(uint32_t delay, react_callback callback)
Create a new DelayEvent.
uint64_t untimed_event_counter
std::vector< UntimedEvent * > untimed_list
RepeatEvent * onRepeatMicros(uint64_t interval, react_callback callback)
Create a new RepeatEvent.
std::priority_queue< TimedEvent *, std::vector< TimedEvent * >, TriggerTimeCompare > timed_queue
int getUntimedEventQueueSize()
int getISREventQueueSize()
SemaphoreHandle_t timed_queue_mutex_
ISREvent * onInterrupt(uint8_t pin_number, int mode, react_callback callback)
Create a new ISREvent (interrupt event)
RepeatEvent * onRepeat(uint32_t interval, react_callback callback)
Create a new RepeatEvent.
uint64_t getUntimedEventCount()
SemaphoreHandle_t isr_event_list_mutex_
uint64_t getTimedEventCount()
int getTimedEventQueueSize()
uint64_t timed_event_counter
EventLoop(const EventLoop &)=delete
std::vector< ISREvent * > isr_event_list
Event that is triggered on an input pin change.
Event that is triggered repeatedly.
Event that is triggered when there is input available at the given Arduino Stream.
Event that is triggered unconditionally at each execution loop.
TimedEvents are called based on elapsing of time.
Events that are triggered based on something else than time.
std::function< void()> react_callback