19 lines
366 B
Forth
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
|