doc/modules/luaevent.core.bufferevent.mdwn

Sun, 25 Nov 2007 17:43:57 -0500

author
Thomas Harning Jr <harningt@gmail.com>
date
Sun, 25 Nov 2007 17:43:57 -0500
changeset 56
b5b5ff03a4a3
parent 47
14d548920f6d
child 57
e20f175aa158
permissions
-rw-r--r--

docs: Learned bufferevent's new get_read/write

47
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
1 ----
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
2 Functions:
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
3
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
4 [[toc levels=1]]
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
5
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
6 ## Read/Write/Error Callback:
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
7 * Input: `(bufferevent, what)`
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
8 * `bufferevent` - Reference to the bufferevent that raised the callback
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
9 * `what` - What happened:
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
10 * == `EVBUFFER_READ` - Buffer contains at least low-watermark length and no more than high-watermark length
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
11 * == `EVBUFFER_WRITE` - Buffer ready to write to
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
12 * (other) - Error condition
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
13 * May be or-ed/added with `EVBUFFER_READ`/`EVBUFFER_WRITE` to specify where it happened
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
14 * `EVBUFFER_ERROR` - Marks error condition (need to look at 'errno' for error.. not exposed yet)
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
15 * `EVBUFFER_TIMEOUT` - Marks activity timeout
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
16 * `EVBUFFER_EOF` - Marks disconnection/end-of-file condition
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
17
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
18 ## bufferevent.new
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
19 * Input: `(fd, read, write, error)`
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
20 * `fd` - File descriptor to watch
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
21 * `read` - (may be nil) - callback to call when data in buffer is above the low watermark
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
22 * `write` - (may be nil) - callback to call when the output buffer contains less data than the low watermark
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
23 * `error` - callback to call when there is an erroneous condition
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
24
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
25 ## bufferevent (__gc)
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
26 * Releases the bufferevent
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
27 * Disconnects event buffers since they were owned by the bufferevent object in 'C' land
14d548920f6d docs: Added documentation for bufferevent
Thomas Harning Jr <harningt@gmail.com>
parents: 43
diff changeset
28 * Disconnects all references so that any erroneous callbacks don't cause failures
56
b5b5ff03a4a3 docs: Learned bufferevent's new get_read/write
Thomas Harning Jr <harningt@gmail.com>
parents: 47
diff changeset
29
b5b5ff03a4a3 docs: Learned bufferevent's new get_read/write
Thomas Harning Jr <harningt@gmail.com>
parents: 47
diff changeset
30 ## bufferevent:get_read
b5b5ff03a4a3 docs: Learned bufferevent's new get_read/write
Thomas Harning Jr <harningt@gmail.com>
parents: 47
diff changeset
31 * Obtains the input buffer associated w/ the bufferevent
b5b5ff03a4a3 docs: Learned bufferevent's new get_read/write
Thomas Harning Jr <harningt@gmail.com>
parents: 47
diff changeset
32
b5b5ff03a4a3 docs: Learned bufferevent's new get_read/write
Thomas Harning Jr <harningt@gmail.com>
parents: 47
diff changeset
33 ## bufferevent:get_write
b5b5ff03a4a3 docs: Learned bufferevent's new get_read/write
Thomas Harning Jr <harningt@gmail.com>
parents: 47
diff changeset
34 * Obtains the output buffer associated w/ the bufferevent

mercurial