… | |
… | |
191 | use common::sense; |
191 | use common::sense; |
192 | |
192 | |
193 | use base 'Exporter'; |
193 | use base 'Exporter'; |
194 | |
194 | |
195 | BEGIN { |
195 | BEGIN { |
196 | our $VERSION = '3.3'; |
196 | our $VERSION = '3.31'; |
197 | |
197 | |
198 | our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close |
198 | our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close |
199 | aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx |
199 | aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx |
200 | aio_scandir aio_symlink aio_readlink aio_sync aio_fsync |
200 | aio_scandir aio_symlink aio_readlink aio_sync aio_fsync |
201 | aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead |
201 | aio_fdatasync aio_sync_file_range aio_pathsync aio_readahead |
… | |
… | |
656 | my $grp = aio_group $cb; |
656 | my $grp = aio_group $cb; |
657 | |
657 | |
658 | aioreq_pri $pri; |
658 | aioreq_pri $pri; |
659 | add $grp aio_open $src, O_RDONLY, 0, sub { |
659 | add $grp aio_open $src, O_RDONLY, 0, sub { |
660 | if (my $src_fh = $_[0]) { |
660 | if (my $src_fh = $_[0]) { |
661 | my @stat = stat $src_fh; # hmm, might bock over nfs? |
661 | my @stat = stat $src_fh; # hmm, might block over nfs? |
662 | |
662 | |
663 | aioreq_pri $pri; |
663 | aioreq_pri $pri; |
664 | add $grp aio_open $dst, O_CREAT | O_WRONLY | O_TRUNC, 0200, sub { |
664 | add $grp aio_open $dst, O_CREAT | O_WRONLY | O_TRUNC, 0200, sub { |
665 | if (my $dst_fh = $_[0]) { |
665 | if (my $dst_fh = $_[0]) { |
666 | aioreq_pri $pri; |
666 | aioreq_pri $pri; |
… | |
… | |
1133 | =item $grp->cancel_subs |
1133 | =item $grp->cancel_subs |
1134 | |
1134 | |
1135 | Cancel all subrequests and clears any feeder, but not the group request |
1135 | Cancel all subrequests and clears any feeder, but not the group request |
1136 | itself. Useful when you queued a lot of events but got a result early. |
1136 | itself. Useful when you queued a lot of events but got a result early. |
1137 | |
1137 | |
|
|
1138 | The group request will finish normally (you cannot add requests to the |
|
|
1139 | group). |
|
|
1140 | |
1138 | =item $grp->result (...) |
1141 | =item $grp->result (...) |
1139 | |
1142 | |
1140 | Set the result value(s) that will be passed to the group callback when all |
1143 | Set the result value(s) that will be passed to the group callback when all |
1141 | subrequests have finished and set the groups errno to the current value |
1144 | subrequests have finished and set the groups errno to the current value |
1142 | of errno (just like calling C<errno> without an error number). By default, |
1145 | of errno (just like calling C<errno> without an error number). By default, |