… | |
… | |
212 | $_[0] > 0 or die "read error: $!"; |
212 | $_[0] > 0 or die "read error: $!"; |
213 | print "read $_[0] bytes: <$buffer>\n"; |
213 | print "read $_[0] bytes: <$buffer>\n"; |
214 | }; |
214 | }; |
215 | |
215 | |
216 | =item aio_move $srcpath, $dstpath, $callback->($status) |
216 | =item aio_move $srcpath, $dstpath, $callback->($status) |
217 | |
|
|
218 | [EXPERIMENTAL due to internal aio_group use] |
|
|
219 | |
217 | |
220 | Try to move the I<file> (directories not supported as either source or |
218 | Try to move the I<file> (directories not supported as either source or |
221 | destination) from C<$srcpath> to C<$dstpath> and call the callback with |
219 | destination) from C<$srcpath> to C<$dstpath> and call the callback with |
222 | the C<0> (error) or C<-1> ok. |
220 | the C<0> (error) or C<-1> ok. |
223 | |
221 | |
… | |
… | |
375 | |
373 | |
376 | The callback a single argument which is either C<undef> or an array-ref |
374 | The callback a single argument which is either C<undef> or an array-ref |
377 | with the filenames. |
375 | with the filenames. |
378 | |
376 | |
379 | =item aio_scandir $path, $maxreq, $callback->($dirs, $nondirs) |
377 | =item aio_scandir $path, $maxreq, $callback->($dirs, $nondirs) |
380 | |
|
|
381 | [EXPERIMENTAL due to internal aio_group use] |
|
|
382 | |
378 | |
383 | Scans a directory (similar to C<aio_readdir>) but additionally tries to |
379 | Scans a directory (similar to C<aio_readdir>) but additionally tries to |
384 | separate the entries of directory C<$path> into two sets of names, ones |
380 | separate the entries of directory C<$path> into two sets of names, ones |
385 | you can recurse into (directories or links to them), and ones you cannot |
381 | you can recurse into (directories or links to them), and ones you cannot |
386 | recurse into (everything else). |
382 | recurse into (everything else). |
… | |
… | |
548 | |
544 | |
549 | [EXPERIMENTAL] |
545 | [EXPERIMENTAL] |
550 | |
546 | |
551 | This is a very special aio request: Instead of doing something, it is a |
547 | This is a very special aio request: Instead of doing something, it is a |
552 | container for other aio requests, which is useful if you want to bundle |
548 | container for other aio requests, which is useful if you want to bundle |
553 | many requests into a single, composite, request. |
549 | many requests into a single, composite, request with a definite callback |
|
|
550 | and the ability to cancel the whole request with its subrequests. |
554 | |
551 | |
555 | Returns an object of class L<IO::AIO::GRP>. See its documentation below |
552 | Returns an object of class L<IO::AIO::GRP>. See its documentation below |
556 | for more info. |
553 | for more info. |
557 | |
554 | |
558 | Example: |
555 | Example: |
… | |
… | |
577 | phase and still requires a worker thread. Thus, the callback will not |
574 | phase and still requires a worker thread. Thus, the callback will not |
578 | be executed immediately but only after other requests in the queue have |
575 | be executed immediately but only after other requests in the queue have |
579 | entered their execution phase. This can be used to measure request |
576 | entered their execution phase. This can be used to measure request |
580 | latency. |
577 | latency. |
581 | |
578 | |
582 | =item IO::AIO::aio_sleep $fractional_seconds, $callback->() *NOT EXPORTED* |
579 | =item IO::AIO::aio_busy $fractional_seconds, $callback->() *NOT EXPORTED* |
583 | |
580 | |
584 | Mainly used for debugging and benchmarking, this aio request puts one of |
581 | Mainly used for debugging and benchmarking, this aio request puts one of |
585 | the request workers to sleep for the given time. |
582 | the request workers to sleep for the given time. |
586 | |
583 | |
587 | While it is theoretically handy to have simple I/O scheduling requests |
584 | While it is theoretically handy to have simple I/O scheduling requests |
588 | like sleep and file handle readable/writable, the overhead this creates |
585 | like sleep and file handle readable/writable, the overhead this creates is |
589 | is immense, so do not use this function except to put your application |
586 | immense (it blocks a thread for a long time) so do not use this function |
590 | under artificial I/O pressure. |
587 | except to put your application under artificial I/O pressure. |
591 | |
588 | |
592 | =back |
589 | =back |
593 | |
590 | |
594 | =head2 IO::AIO::REQ CLASS |
591 | =head2 IO::AIO::REQ CLASS |
595 | |
592 | |