Future-Uring
view release on metacpan or search on metacpan
lib/Future/Uring.pm view on Meta::CPAN
=head2 submissions_available
Future::Uring::submissions_available;
Check the number of available submission queue events. One may need to submit pending entries before creating a chain, because all entries in a linked chains must be submitted together.
=head2 to_handle
my $handle = Future::Uring::to_handle($fh)
This takes a Perl handle and turns it into a L<Future::Uring::Handle>.
=head2 ring
my $ring = Future::Uring::ring();
This returns the IO::Uring instance used by this module.
=head2 link
await Future::Uring::link($old_path, $new_path, %options)
This creates a hard link from C<$new_path> to C<$old_path>.
This takes two additional named arguments:
=over 4
=item * follow_symlink
if true and C<$oldpath> is a symlink, it will be followed before the operation.
=item * old_base
A dirhandle that acts as the base of any relative C<$oldpath>. Defaults to the current working directory (represented by undef).
=item * new_base
A dirhandle that acts as the base of any relative C<$newpath>. Defaults to the current working directory (represented by undef).
=back
=head2 mkdir
await Future::Uring::mkdir($dirname, %options)
Make directory C<$dirname>. It takes one additional named argument.
=over 4
=item * base
A dirhandle that acts as the base of any relative C<$path>. Defaults to the current working directory (represented by undef).
=back
=head2 nop
await Future::Uring::nop(%options);
This will do absolutely nothing. This can be useful though if you want to run some code after submissions have been made or need to keep something alive until that point.
=head2 open
my $handle = await Future::Uring::open($filename, $mode = '<', %options);
This opens a file, and returns it as a new L<handle|Future::Uring::Handle>.
This takes several additional options:
=over 4
=item * mode
The permission mode that will be used if the file is newly created (e.g. C<0644>).
=item * base
A dirhandle that acts as the base of any relative C<$path>. Defaults to the current working directory (represented by undef).
=item * flags
The value of the C<flags> argument to C<open>, it will be amended with the named arguments below.
=item * d_sync
If true, write operations on the file will complete according to the requirements of synchronized I/O data integrity completion.
=item * exclusive
Ensure that this call creates the file: if this flag is specified in conjunction with a creating C<$mode>, and path already exists, then open() fails with the error C<EEXIST>.
=item * no_follow
If the trailing component (i.e., basename) of path is a symbolic link, then the open fails with the error ELOOP. Symbolic links in earlier components of the pathname will still be followed.
=item * sync
If true write operations on the file will complete according to the requirements of synchronized I/O file integrity completion (by contrast with the synchronized I/O data integrity completion provided by C<d_sync>.
=back
=head2 rename
await Future::Uring::rename($old_path, $new_path, %options)
Rename the file at C<$old_path> to C<$new_path>.
=over 4
=item * exchange
Atomically exchange oldpath and newpath. Both pathnames must exist but may be of different types (e.g., one could be a non-empty directory and the other a symbolic link).
=item * no_replace
Don't overwrite newpath of the rename. Return an error if newpath already exists.
=item * old_base
A dirhandle that acts as the base of any relative C<$oldpath>. Defaults to the current working directory (represented by undef).
( run in 2.069 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )