blob: d3e8778f4741aee9f84bbec879833c6de052f065 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-- Listener Scenario
create socket, perform bind, set listening
+add read-event listener
+start loop
-- Comm Scenario
provided socket
-inside loop
begin coro
read - data not ready
yield sock, needRead
end coro
coro parent == callback
(coro parent
call coro(sock, event)
if not ok, go back.. end
if newEvent ~= event then
unset event, reset newEvent
end)
|