https://github.com/aep/clay.io.events
Asynch i/o for clay.
https://github.com/aep/clay.io.events
Last synced: 3 months ago
JSON representation
Asynch i/o for clay.
- Host: GitHub
- URL: https://github.com/aep/clay.io.events
- Owner: aep
- Created: 2012-01-07T18:14:14.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-01-07T18:17:06.000Z (over 14 years ago)
- Last Synced: 2025-02-24T14:54:31.086Z (over 1 year ago)
- Homepage:
- Size: 85.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
this is a prototype implementation of an asynch io toolkit for clay.
The main building blocks are
- EventSource
- Dispatcher
- EventCallback
An EventSource can be any T that qualifies EventSource?(T), but for
doing any useful, there must be a listen(D,S) implementation, where
D is the os specific Dispatcher.
The os abstraction magic happens in the dispatcher. O unixoid OS this
is basicly poll() and the different listen() functions simply forward
the fd of whatever the EventSource is to the FD listen() function.
For example listen(d:UnixDispatcher, s:Socket) would be implemented as
listen(d, fileDescriptor(s)), hiding away the os specific event source.
Unix is easy, since everything - with the exception of timers - is a
file descriptor. On windows the real power of the abstraction shows,
when we need to imeplement complex redirection behind the users back.
-------------------------------------------------------------------------
Compiling the test app:
have clay in path and type make.
./test will be your friend
-------------------------------------------------------------------------
Installing:
as root, type make install. be sure PREFIX matches your installation.
Also note that clay currently does not handle local includes as priority,
so you need to remove the installed files when recompiling the test app.