ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.pm
(Generate patch)

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.70 by root, Tue Oct 24 03:40:38 2006 UTC vs.
Revision 1.71 by root, Tue Oct 24 11:57:30 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines