moontalk/server/eventloop-server-experiment/main.4th

19 lines
366 B
Plaintext
Raw Normal View History

2024-02-03 12:37:01 -05:00
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