UV - Perl interface to libuv
#!/usr/bin/env perl
use strict;
use warnings;
use UV;
# hi-resolution time
my $hi_res_time = UV::hrtime();
# A new loop
my $loop = UV::Loop->new();
# default loop
my $loop = UV::Loop->default_loop(); # convenience constructor
my $loop = UV::Loop->new(1); # Tell the constructor you want the default loop
# run a loop with one of three options:
# UV_RUN_DEFAULT, UV_RUN_ONCE, UV_RUN_NOWAIT
$loop->run(); # runs with UV_RUN_DEFAULT
$loop->run(UV::Loop::UV_RUN_DEFAULT); # explicitly state UV_RUN_DEFAULT
$loop->run(UV::Loop::UV_RUN_ONCE);
$loop->run(UV::Loop::UV_RUN_NOWAIT);
This module provides an interface to libuv. We will try to document things here as best as we can, but we also suggest you look at the libuv docs directly for more details on how things work.
Event loops that work properly on all platforms. YAY!
Argument list too long
Permission denied
Address already in use
Address not available
Address family not supported
Resource temporarily unavailable
Address family not supported
Temporary failure
Bad ai_flags value
Invalid value for hints
Request canceled
Permanent failure
ai_family not supported
Out of memory
No address
Unknown node or service
Argument buffer overflow
Resolved protocol is unknown
Service not available for socket type
Socket type not supported
Connection already in progress
Bad file descriptor
Resource busy or locked
Operation canceled
Invalid Unicode character
Software caused connection abort
Connection refused
Connection reset by peer
Destination address required
File already exists
Bad address in system call argument
File too large
Host is unreachable
Interrupted system call
Invalid argument
i/o error
Socket is already connected
Illegal operation on a directory
Too many symbolic links encountered
Too many open files
Too many links
Message too long
Name too long
Network is down
Network is unreachable
File table overflow
No buffer space available
No such device
No such file or directory
Not enough memory
Machine is not on the network
Protocol not available
No space left on device
Function not implemented
Socket is not connected
Not a directory
Directory not empty
Socket operation on non-socket
Operation not supported on socket
No such device or address
End of file
Operation not permitted
Broken pipe
Protocol error
Protocol not supported
Protocol wrong type for socket
Result too large
Read-only file system
Cannot send after transport endpoint shutdown
Invalid seek
No such process
Connection timed out
Text file is busy
Cross-device link not permitted
Unknown error
The following functions are available:
my $loop = UV::default_loop();
# You can also get it with the UV::Loop methods below:
my $loop = UV::Loop->default_loop();
my $loop = UV::Loop->default();
# Passing a true value as the first arg to the UV::Loop constructor
# will also return the default loop
my $loop = UV::Loop->new(1);
Returns the default loop (which is a singleton object). This module already creates the default loop and you get access to it with this method.
my $uint64_t = UV::hrtime();
Get the current Hi-Res time (uint64_t
).
Daisuke Murase <[email protected]
>
Chase Whitener <[email protected]
>
Copyright 2012, Daisuke Murase.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.