… | |
… | |
603 | }; |
603 | }; |
604 | |
604 | |
605 | This makes it very easy to create composite requests (see the source of |
605 | This makes it very easy to create composite requests (see the source of |
606 | C<aio_move> for an application) that work and feel like simple requests. |
606 | C<aio_move> for an application) that work and feel like simple requests. |
607 | |
607 | |
|
|
608 | =over 4 |
|
|
609 | |
608 | The IO::AIO::GRP objects will be cleaned up during calls to |
610 | =item * The IO::AIO::GRP objects will be cleaned up during calls to |
609 | C<IO::AIO::poll_cb>, just like any other request. |
611 | C<IO::AIO::poll_cb>, just like any other request. |
610 | |
612 | |
611 | They can be canceled like any other request. Canceling will cancel not |
613 | =item * They can be canceled like any other request. Canceling will cancel not |
612 | only the request itself, but also all requests it contains. |
614 | only the request itself, but also all requests it contains. |
613 | |
615 | |
614 | They can also can also be added to other IO::AIO::GRP objects. |
616 | =item * They can also can also be added to other IO::AIO::GRP objects. |
615 | |
617 | |
616 | You must not add requests to a group from within the group callback (or |
618 | =item * You must not add requests to a group from within the group callback (or |
617 | any later time). |
619 | any later time). |
|
|
620 | |
|
|
621 | =item * This does not harmonise well with C<max_outstanding>, so best do |
|
|
622 | not combine C<aio_group> with it. Groups and feeders are recommended for |
|
|
623 | this kind of concurrency-limiting. |
|
|
624 | |
|
|
625 | =back |
618 | |
626 | |
619 | Their lifetime, simplified, looks like this: when they are empty, they |
627 | Their lifetime, simplified, looks like this: when they are empty, they |
620 | will finish very quickly. If they contain only requests that are in the |
628 | will finish very quickly. If they contain only requests that are in the |
621 | C<done> state, they will also finish. Otherwise they will continue to |
629 | C<done> state, they will also finish. Otherwise they will continue to |
622 | exist. |
630 | exist. |
… | |
… | |
784 | |
792 | |
785 | Under normal circumstances you don't need to call this function. |
793 | Under normal circumstances you don't need to call this function. |
786 | |
794 | |
787 | =item $oldnreqs = IO::AIO::max_outstanding $nreqs |
795 | =item $oldnreqs = IO::AIO::max_outstanding $nreqs |
788 | |
796 | |
|
|
797 | [DEPRECATED] |
|
|
798 | |
789 | Sets the maximum number of outstanding requests to C<$nreqs>. If you |
799 | Sets the maximum number of outstanding requests to C<$nreqs>. If you |
790 | try to queue up more than this number of requests, the caller will block until |
800 | try to queue up more than this number of requests, the caller will block until |
791 | some requests have been handled. |
801 | some requests have been handled. |
792 | |
802 | |
793 | The default is very large, so normally there is no practical limit. If you |
803 | The default is very large, so normally there is no practical limit. If you |
794 | queue up many requests in a loop it often improves speed if you set |
804 | queue up many requests in a loop it often improves speed if you set |
795 | this to a relatively low number, such as C<100>. |
805 | this to a relatively low number, such as C<100>. |
|
|
806 | |
|
|
807 | This function does not work well together with C<aio_group>'s, and their |
|
|
808 | feeder interface is better suited to limiting concurrency, so do not use |
|
|
809 | this function. |
796 | |
810 | |
797 | Under normal circumstances you don't need to call this function. |
811 | Under normal circumstances you don't need to call this function. |
798 | |
812 | |
799 | =back |
813 | =back |
800 | |
814 | |