Commit graph

8 commits

Author SHA1 Message Date
Tim Culverhouse
cecf774ed2 event: implement pollEvent and tryEvent
Implement a way for an application to poll the event loop in a blocking
way without popping an event. Implement a non-blocking pop. These
together enable an application to poll the event loop and then drain it.
This is useful when lots of events are delivered in a short amount of
time so an application can batch process the events and then render.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-03-11 09:24:42 -05:00
Tim Culverhouse
cf71bb4e7c queue: fix thread safety
Fix thread safety with changes by leeward on IRC. leeward put this code
on sourcehut here: https://hg.sr.ht/~nmichaels/threadsafeq
2024-03-01 12:25:15 -06:00
Tim Culverhouse
0d730aba80 queue: update comments, add tryPop
Update comments on queue, and add a tryPop function which is nonblocking

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-02-19 10:11:18 -06:00
Tim Culverhouse
c99517181e queue: remove useless defer 2024-02-03 10:05:42 -06:00
Tim Culverhouse
393279d978 queue: add tryPush method, a nonblocking push attempt
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-22 09:33:23 -06:00
Tim Culverhouse
79b48e4dea queue: add comment
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-19 12:28:48 -06:00
Tim Culverhouse
11b7b86913 core: functional App structure
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-18 19:02:59 -06:00
Tim Culverhouse
891bab73dd queue: add initial queue and app structure
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-18 16:16:21 -06:00