File: PLAN

package info (click to toggle)
lua-event 0.4.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: ansic: 741; makefile: 40; sh: 1
file content (19 lines) | stat: -rw-r--r-- 362 bytes parent folder | download | duplicates (7)
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)