summaryrefslogtreecommitdiff
path: root/docs/api-notes/common/lib_common/WaitForEvent.txt
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2009-03-28 12:25:05 +0000
committerChris Wilson <chris+github@qwirx.com>2009-03-28 12:25:05 +0000
commit35e48b188329bf1048dfe154247b3259441de29f (patch)
tree289136939151abaae7447c94f684f134ea4b3381 /docs/api-notes/common/lib_common/WaitForEvent.txt
parent5ca3021ed632ff92d0d93d34ef2b75bdfd956d38 (diff)
Reorganise docs in trunk to match distribution layout, which is cleaner,
and makes Makefile work on distributions and trunk equally.
Diffstat (limited to 'docs/api-notes/common/lib_common/WaitForEvent.txt')
-rw-r--r--docs/api-notes/common/lib_common/WaitForEvent.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/api-notes/common/lib_common/WaitForEvent.txt b/docs/api-notes/common/lib_common/WaitForEvent.txt
new file mode 100644
index 00000000..0bc55726
--- /dev/null
+++ b/docs/api-notes/common/lib_common/WaitForEvent.txt
@@ -0,0 +1,16 @@
+CLASS WaitForEvent
+
+This class implements a way to efficiently wait on one or more system objects, for example sockets and file descriptors. Where kqueue() is available, this is used, otherwise poll(). The poll() implementation is less comprehensive and rather more limited.
+
+To add a compatible object, call Add(). To remove it, call Remove(). To wait for an object to become ready, call Wait(), which returns a pointer to the first ready object, or 0 for a timeout.
+
+The timeout is set either in the constructor, or using the SetTimout() method. It is specified in milliseconds.
+
+The kqueue based implementation will automatically remove objects when they are closed (actually, the OS does this), but the poll implementation requires that Remove() be called.
+
+The flags passed to Add() or Remove() are passed to the object, and are ignored by this class.
+
+For an object to be able to be added to the list, it should implement FillInKEvent() and FillInPoll() for kqueue and poll implementations respectively. Use the PLATFORM_KQUEUE_NOT_SUPPORTED define to test which is necessary for the platform.
+
+It does not have to be derived off any particular class, as it uses templates to be compatible with any class.
+