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.68 by root, Tue Oct 24 03:17:39 2006 UTC vs.
Revision 1.69 by root, Tue Oct 24 03:40:25 2006 UTC

132is C<0>, the minimum and maximum priorities are C<-4> and C<4>, 132is C<0>, the minimum and maximum priorities are C<-4> and C<4>,
133respectively. Requests with higher priority will be serviced first. 133respectively. Requests with higher priority will be serviced first.
134 134
135The priority will be reset to C<0> after each call to one of the C<aio_> 135The priority will be reset to C<0> after each call to one of the C<aio_>
136functions. 136functions.
137
138Example: open a file with low priority, then read something from it with
139higher priority so the read request is serviced before other low priority
140open requests (potentially spamming the cache):
141
142 aioreq_pri -3;
143 aio_open ..., sub {
144 return unless $_[0];
145
146 aioreq_pri -2;
147 aio_read $_[0], ..., sub {
148 ...
149 };
150 };
151
152=item aioreq_nice $pri_adjust
153
154Similar to C<aioreq_pri>, but subtracts the given value from the current
155priority, so effects are cumulative.
137 156
138=item aio_open $pathname, $flags, $mode, $callback->($fh) 157=item aio_open $pathname, $flags, $mode, $callback->($fh)
139 158
140Asynchronously open or create a file and call the callback with a newly 159Asynchronously open or create a file and call the callback with a newly
141created filehandle for the file. 160created filehandle for the file.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines