moontalk/server/eventloop-server-experiment/main.4th
Emil Williams 7721b77c93
update
2024-02-03 17:37:01 +00:00

19 lines
366 B
Forth

require check-gforth.4th
require eventloop.4th
require event-constants.4th
require server.4th
: custom-eventloop ( -- )
BEGIN
eventloop.has-events? IF
eventloop.dispatch
ELSE
server-idle? IF
10 ms false server-idle!
THEN
0 0 events.enqueue eventloop.dispatch
THEN
AGAIN ;
' custom-eventloop catch close-server throw