… | |
… | |
230 | If an EOF condition has been detected but no C<on_eof> callback has been |
230 | If an EOF condition has been detected but no C<on_eof> callback has been |
231 | set, then a fatal error will be raised with C<$!> set to <0>. |
231 | set, then a fatal error will be raised with C<$!> set to <0>. |
232 | |
232 | |
233 | =item on_drain => $cb->($handle) |
233 | =item on_drain => $cb->($handle) |
234 | |
234 | |
235 | This sets the callback that is called when the write buffer becomes empty |
235 | This sets the callback that is called once when the write buffer becomes |
236 | (or immediately if the buffer is empty already). |
236 | empty (and immediately when the handle object is created). |
237 | |
237 | |
238 | To append to the write buffer, use the C<< ->push_write >> method. |
238 | To append to the write buffer, use the C<< ->push_write >> method. |
239 | |
239 | |
240 | This callback is useful when you don't want to put all of your write data |
240 | This callback is useful when you don't want to put all of your write data |
241 | into the queue at once, for example, when you want to write the contents |
241 | into the queue at once, for example, when you want to write the contents |
… | |
… | |
886 | |
886 | |
887 | The write queue is very simple: you can add data to its end, and |
887 | The write queue is very simple: you can add data to its end, and |
888 | AnyEvent::Handle will automatically try to get rid of it for you. |
888 | AnyEvent::Handle will automatically try to get rid of it for you. |
889 | |
889 | |
890 | When data could be written and the write buffer is shorter then the low |
890 | When data could be written and the write buffer is shorter then the low |
891 | water mark, the C<on_drain> callback will be invoked. |
891 | water mark, the C<on_drain> callback will be invoked once. |
892 | |
892 | |
893 | =over 4 |
893 | =over 4 |
894 | |
894 | |
895 | =item $handle->on_drain ($cb) |
895 | =item $handle->on_drain ($cb) |
896 | |
896 | |