Branch: Tag:

2004-04-04

2004-04-04 23:53:44 by Martin Stjernholm <mast@lysator.liu.se>

Documented a behavior for callbacks that I haven't realized before.

Rev: lib/modules/Stdio.pmod/module.pmod:1.193

1146:   <dt class='head--doc'>Description</dt>   <dd class='body--doc'><p>These functions set the various callbacks, which will be called    when various events occur on the stream. A zero as argument will -  remove a callback.</p> +  remove the callback.</p>   <p> A <code>Pike.Backend</code> object is responsible for calling the    callbacks. It requires a thread to be waiting in it to execute    the calls. That means that only one of the callbacks will be
1187:   <dd class='body--doc'><p>Callbacks are also set by <code>set_nonblocking()</code>.</p>   </dd>   <dt class='head--doc'>Note</dt> + <dd class='body--doc'><p>The callbacks are disabled until they have accessed the stream, +  i.e. the <code>write_cb</code> callback is disabled until something has +  been written with <code>write</code>, and the <code>write_oob_cb</code> callback is +  disabled until something has been written with <code>write_oob</code>. +  Since the read callbacks get the data right away, this effect is +  not noticeable for them.</p> + </dd> + <dt class='head--doc'>Note</dt>   <dd class='body--doc'><p>Installing callbacks means that you will start doing I/O on the    stream from the thread running the backend. If you are running    these set functions from another thread you must be prepared
1204:    the two often are used together they don't have to be.</p>   </dd>   <dt class='head--doc'>Note</dt> - <dd class='body--doc'><p>The file object will stay referenced as long as callbacks are -  installed.</p> + <dd class='body--doc'><p>The file object will stay referenced from the backend object as +  long as there are callbacks that can receive events.</p>   </dd>   <dt class='head--doc'>Bugs</dt>   <dd class='body--doc'><p>Setting a close callback without a read callback currently only