Net::A...Client(3pm)

๐Ÿ“ฆ
version 0.16 ยท 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

โœจ Net::Async::Tangence::Client โœจ

okay bestie, so this is Net::Async::Tangence::Client (it's a 3pm page, a Perl module thing, iykyk) โ€” and it's literally your little portal to a Tangence server using IO::Async. ๐Ÿ’–


๐ŸŒธ NAME ๐ŸŒธ

"Net::Async::Tangence::Client" โ€” connects to a "Tangence" server using "IO::Async", no cap.


๐Ÿ’… DESCRIPTION ๐Ÿ’…

So this class is a subclass of Net::Async::Tangence::Protocol, and what it does is connect to a Tangence server, which means your client program gets to access all the exposed objects chillin' over on the server side. It's a concrete implementation of the "Tangence::Client" mixin โ€” the real deal, not just vibes. ๐Ÿ‘‘

Also, heads up: everything below is about this specific implementation. If you want the general tea on the "Tangence"-specific parts of this class, go read the documentation for Tangence::Client instead. Different page, different lore. ๐Ÿ“–


โœจ PARAMETERS โœจ

These named parameters can be passed to "new" or "configure" (yes, both, slay):

  • identity => STRING โ€” the identity string you send over to the server. It's giving "hi it's me" but in protocol form. ๐Ÿ’Œ
  • on_error => STRING or CODE โ€” the default error-handling policy for method calls. If you set it to the string "carp" or "croak", then a CODE ref gets created for you that calls that function from "Carp". Otherwise? It just has to be a CODE ref, periodt. ๐Ÿšจ

๐ŸŽ€ METHODS ๐ŸŽ€

The methods below that have a trailing ->get documented? Yeah, those return Future instances. Main character async energy fr fr. ๐Ÿ”ฎ

๐ŸŒˆ connect_url ๐ŸŒˆ

$rootobj = $client->connect_url( $url, %args )->get

Connects to a "Tangence" server at the URL you give it. The Future that comes back will yield the root object proxy once it's been obtained โ€” so like, patience, bestie, good things are coming. ๐ŸŒŸ

It takes these named arguments:

  • on_registry => CODE โ€” invoked once the registry object proxy has been obtained from the server.
  • on_root => CODE โ€” invoked once the root object proxy has been obtained from the server. (Both of these: peep the Tangence::Client "tangence_connected" method for the full story.)
  • family => STRING โ€” optional! Can be set to "inet4" or "inet6" to force IPv4 or IPv6 when that's relevant. It gets ignored by the "exec:" and "unix:" schemes though, so don't bother there. ๐Ÿ™ˆ

So these are the URL schemes that get recognised:

  • exec โ€” directly executes the server as a child process. It's mostly here for testing purposes, because the server will only run for this one client and it exits when the client disconnects. One and done. ๐Ÿ’€
exec:///path/to/command?with+arguments

The URL's path should point at the command you need, and the query string gets split on + signs and used as the arguments. The authority section of the URL is ignored, so you can just leave it empty.

  • sshexec โ€” a convenient lil wrapper around the "exec" scheme, for connecting to a server running remotely via ssh. ๐Ÿฆ‹
sshexec://host/path/to/command?with+arguments

The URL's authority section gives you the SSH server (and optionally the username), and the path and query sections get used just like for "exec".

(this scheme is also available as "ssh", but ngl that name is deprecated now) ๐Ÿ˜ญ
  • tcp โ€” connects to a server via a TCP socket.
tcp://host:port/

The URL's authority section gives the server's hostname and port number. The other sections of the URL? Ignored. not invited to the party. ๐ŸŽ‰

  • unix โ€” connects to a server via a UNIX local socket.
unix:///path/to/socket

The URL's path section gives the path to the local socket. The other sections of the URL get ignored too. ๐Ÿ’œ

  • sshunix โ€” connects to a server running remotely via a UNIX socket over ssh.
sshunix://host/path/to/socket
(this one works by running perl remotely and sending it a tiny self-contained program that connects STDIN/STDOUT to the given UNIX socket path. It requires the server to have perl at least version 5.6 available in the path, simply as "perl" โ€” so like, make sure that's there or it's not gonna eat.) ๐Ÿ“

๐Ÿซถ AUTHOR ๐Ÿซถ

Paul Evans <leonerd@leonerd.org.uk> โ€” icon, legend, the moment. ๐Ÿ‘‘


and that's the whole page, bestie!! โœจ this was perl v5.36.0, dated 2022-09-10, from your girl Net::A...Client(3pm) โ€” mwah, love u, go connect to something cute ๐Ÿ’–๐ŸŒˆ๐ŸŽ€

๐Ÿ“ฆ where this page comes from