ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.pod
(Generate patch)

Comparing libeio/eio.pod (file contents):
Revision 1.23 by root, Wed Jul 13 21:31:40 2011 UTC vs.
Revision 1.24 by sf-exg, Thu Jul 14 08:51:29 2011 UTC

707=head4 GROUP REQUEST LIFETIME 707=head4 GROUP REQUEST LIFETIME
708 708
709Left alone, a group request will instantly move to the pending state and 709Left alone, a group request will instantly move to the pending state and
710will be finished at the next call of C<eio_poll>. 710will be finished at the next call of C<eio_poll>.
711 711
712There usefulness stems from the fact that, if a subrequest is added to a 712The usefulness stems from the fact that, if a subrequest is added to a
713group I<before> a call to C<eio_poll>, via C<eio_grp_add>, then the group 713group I<before> a call to C<eio_poll>, via C<eio_grp_add>, then the group
714will not finish until all the subrequests have finished. 714will not finish until all the subrequests have finished.
715 715
716So the usage cycle of a group request is like this: after it is created, 716So the usage cycle of a group request is like this: after it is created,
717you normally instantly add a subrequest. If none is added, the group 717you normally instantly add a subrequest. If none is added, the group
738can return as "the load request". 738can return as "the load request".
739 739
740=item 2) open the file, maybe 740=item 2) open the file, maybe
741 741
742Next, open the file with C<eio_open> and add the request to the group 742Next, open the file with C<eio_open> and add the request to the group
743request and you are finished steting up the request. 743request and you are finished setting up the request.
744 744
745If, for some reason, you cannot C<eio_open> (path is a null ptr?) you 745If, for some reason, you cannot C<eio_open> (path is a null ptr?) you
746cna set C<< grp->result >> to C<-1> to signal an error and let the gorup 746can set C<< grp->result >> to C<-1> to signal an error and let the group
747request finish on its own. 747request finish on its own.
748 748
749=item 3) open callback adds more requests 749=item 3) open callback adds more requests
750 750
751In the open callback, if the open was not successful, copy C<< 751In the open callback, if the open was not successful, copy C<<
753C<-1> to signal an error. 753C<-1> to signal an error.
754 754
755Otherwise, malloc some memory or so and issue a read request, adding the 755Otherwise, malloc some memory or so and issue a read request, adding the
756read request to the group. 756read request to the group.
757 757
758=item 4) continue issuign requests till finished 758=item 4) continue issuing requests till finished
759 759
760In the real callback, check for errors and possibly continue with 760In the real callback, check for errors and possibly continue with
761C<eio_close> or any other eio request in the same way. 761C<eio_close> or any other eio request in the same way.
762 762
763As soon as no new requests are added the group request will finish. Make 763As soon as no new requests are added the group request will finish. Make

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines