aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorThomas Harning Jr <harningt@gmail.com>2007-11-16 11:48:09 -0500
committerThomas Harning Jr <harningt@gmail.com>2007-11-16 11:48:09 -0500
commit39fa0b0f135da37b00842c8f85cf1c814cd7d549 (patch)
tree3c16f6bd5c872f7c0b3ffea816732d7c1c6f793f /doc
parent975557cce6aa32acf63c2607b3469e5f1612257a (diff)
downloadluaevent-prosody-39fa0b0f135da37b00842c8f85cf1c814cd7d549.tar.gz
luaevent-prosody-39fa0b0f135da37b00842c8f85cf1c814cd7d549.zip
docs: Added documentation for bufferevent
Diffstat (limited to 'doc')
-rw-r--r--doc/modules/luaevent.core.bufferevent.mdwn28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/modules/luaevent.core.bufferevent.mdwn b/doc/modules/luaevent.core.bufferevent.mdwn
index e69de29..a2deee2 100644
--- a/doc/modules/luaevent.core.bufferevent.mdwn
+++ b/doc/modules/luaevent.core.bufferevent.mdwn
@@ -0,0 +1,28 @@
+----
+Functions:
+
+[[toc levels=1]]
+
+## Read/Write/Error Callback:
+* Input: `(bufferevent, what)`
+ * `bufferevent` - Reference to the bufferevent that raised the callback
+ * `what` - What happened:
+ * == `EVBUFFER_READ` - Buffer contains at least low-watermark length and no more than high-watermark length
+ * == `EVBUFFER_WRITE` - Buffer ready to write to
+ * (other) - Error condition
+ * May be or-ed/added with `EVBUFFER_READ`/`EVBUFFER_WRITE` to specify where it happened
+ * `EVBUFFER_ERROR` - Marks error condition (need to look at 'errno' for error.. not exposed yet)
+ * `EVBUFFER_TIMEOUT` - Marks activity timeout
+ * `EVBUFFER_EOF` - Marks disconnection/end-of-file condition
+
+## bufferevent.new
+* Input: `(fd, read, write, error)`
+ * `fd` - File descriptor to watch
+ * `read` - (may be nil) - callback to call when data in buffer is above the low watermark
+ * `write` - (may be nil) - callback to call when the output buffer contains less data than the low watermark
+ * `error` - callback to call when there is an erroneous condition
+
+## bufferevent (__gc)
+* Releases the bufferevent
+ * Disconnects event buffers since they were owned by the bufferevent object in 'C' land
+ * Disconnects all references so that any erroneous callbacks don't cause failures