flipperdevices / flipperzero-firmware

Flipper Zero firmware source code
https://flipperzero.one
GNU General Public License v3.0
12.62k stars 2.69k forks source link

[FL-3833] Furi: event loop #3675

Closed skotopes closed 3 months ago

skotopes commented 4 months ago

What's new

Implemented

Missing

Verification

Checklist (For Reviewer)

github-actions[bot] commented 4 months ago

Compiled f7 firmware for commit cc0f7e11:

CookiePLMonster commented 4 months ago

Can epoll events add/remove message queues to/from that epoll or is it not allowed?

skotopes commented 4 months ago

@CookiePLMonster yes, that should be possible. However I have not yet covered it with tests.

CookiePLMonster commented 4 months ago

@skotopes the reason I'm asking because literally the first thing that came to mind when I studied this PR was "Does this mean the scenes in a scene manager can now easily have their own message queues if needed?" which naturally means queues would be added and removed from a view dispatcher call (I think?).

skotopes commented 4 months ago

@CookiePLMonster yes. That was original intent of this PR: one event loop to rule them all.

CookiePLMonster commented 3 months ago

Now that the PR is out of draft, question about the usage - if furi_event_loop_message_queue_subscribe mandates the event loop must be idle for subscriptions/unsubscriptions to work, how does one add/remove message queues during the lifetime of the event loop? For example when switching scenes.

skotopes commented 3 months ago

@CookiePLMonster this feature coming in next release. This PR is a first part of many )