NAME
Net::Async::Tangence::Client - connect to a Tangence server using IO::Async
DESCRIPTION
This subclass of Net::Async::Tangence::Protocol connects to a Tangence server, allowing the client program to access exposed objects in the server. It is a concrete implementation of the Tangence::Client mixin.
The following documentation concerns this specific implementation of the client; for more general information on the Tangence-specific parts of this class, see instead the documentation for Tangence::Client.
PARAMETERS
The following named parameters may be passed to new or configure:
- identity => STRING
-
The identity string to send to the server.
- on_error => STRING or CODE
-
Default error-handling policy for method calls. If set to either of the strings
carporcroakthen a CODE ref will be created that invokes the given function fromCarp; otherwise must be a CODE ref.
METHODS
The following methods documented with a trailing call to ->get return Future instances.
connect_url
$rootobj = $client->connect_url( $url, %args )->get
Connects to a Tangence server at the given URL. The returned Future will yield the root object proxy once it has been obtained.
Takes the following named arguments:
- on_registry => CODE
- on_root => CODE
-
Invoked once the registry and root object proxies have been obtained from the server. See the documentation the Tangence::Client
tangence_connectedmethod. - family => STRING
-
Optional. May be set to
inet4orinet6to force IPv4 or IPv6 if relevant. Ignored byexec:andunix:schemes.
The following URL schemes are recognised:
exec
Directly executes the server as a child process. This is largely provided for testing purposes, as the server will only run for this one client; it will exit when the client disconnects.
exec:///path/to/command?with+argumentsThe URL's path should point to the required command, and the query string will be split on
+signs and used as the arguments. The authority section of the URL will be ignored, so may be left empty.sshexec
A convenient wrapper around the
execscheme, to connect to a server running remotely via ssh.sshexec://host/path/to/command?with+argumentsThe URL's authority section will give the SSH server (and optionally username), and the path and query sections will be used as for
exec.(This scheme is also available as
ssh, though this name is now deprecated)tcp
Connects to a server via a TCP socket.
tcp://host:port/The URL's authority section will be used to give the server's hostname and port number. The other sections of the URL will be ignored.
unix
Connects to a server via a UNIX local socket.
unix:///path/to/socketThe URL's path section will give the path to the local socket. The other sections of the URL will be ignored.
sshunix
Connects to a server running remotely via a UNIX socket over ssh.
sshunix://host/path/to/socket(This is implemented by running perl remotely and sending it a tiny self-contained program that connects STDIN/STDOUT to the given UNIX socket path. It requires that the server has perl at least version 5.6 available in the path simply as
perl)
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>