-
- # Queue of events to be received by the main thread
- var event_queue = new ConcurrentList[AppEvent]
-
- # Call `react` on all `AppEvent` available in `event_queue`
- protected fun loop_on_ui_callbacks
- do
- var queue = event_queue
- while not queue.is_empty do
- var event = queue.pop
- event.react
- end
- end
-
- redef fun run
- do
- loop
- # Process Android events
- poll_looper 100
-
- # Process app.nit events
- loop_on_ui_callbacks
- end
- end