Search found 3 matches

by profeldoo
Fri Feb 02, 2024 3:00 pm
Forum: ESP-IDF
Topic: [event loop] Why should a handler not do any registrations on its own event loop?
Replies: 4
Views: 1131

Re: [event loop] Why should a handler not do any registrations on its own event loop?

Thanks, good point. So, a 'strong form' of the rule stated in the docs: Do not register/unregister other handlers inside the handler itself. would be: Inside the handler, do not register/unregister other handlers to/from the event that just fired. You are allowed to register/unregister handlers to/f...
by profeldoo
Fri Feb 02, 2024 8:54 am
Forum: ESP-IDF
Topic: [event loop] Why should a handler not do any registrations on its own event loop?
Replies: 4
Views: 1131

Re: [event loop] Why should a handler not do any registrations on its own event loop?

I got my answer from ChatGPT. My conclusion: if you do not do crazy stuff like "triggering another event within registration itself" to put the event loop into an infinite loop, you can do it and nothing will go wrong. If anyone is interested, here is the answer (3 pics). eLoop1.png eLoop2.png eLoop...
by profeldoo
Thu Feb 01, 2024 11:54 am
Forum: ESP-IDF
Topic: [event loop] Why should a handler not do any registrations on its own event loop?
Replies: 4
Views: 1131

[event loop] Why should a handler not do any registrations on its own event loop?

It says here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/system/esp_event.html#handler-un-registering-itself In general, an event handler run by an event loop is not allowed to do any registering/unregistering activity on that event loop. Why is that, or, why could i...