NAME
IPC::MicroSocket::Client
- client connector
SYNOPSIS
use v5.36;
use Future::AsyncAwait;
use IPC::MicroSocket::Client;
my $client = IPC::MicroSocket::Client->new_unix( path => "my-app.sock" );
say await $client->request( "PING" );
DESCRIPTION
This module provides the client connector class for IPC::MicroSocket.
CONSTRUCTOR
new_unix
$client = IPC::MicroSocket::Client->new_unix( path => $path );
A convenience constructor for connecting a new client instance to a given UNIX socket path.
METHODS
request
@response = await $client->request( @args );
Sends a REQUEST
frame with the given arguments, waiting for a response. The returned future will complete with its RESPONSE
frame.
subscribe
await $client->subscribe( $topic, $on_recv );
$on_recv->( @args );
Sends a SUBSCRIBE
frame for the given topic name, then waits indefinitely for PUBLISH
frames that match it. Each received frame will invoke the $on_recv
callback.
Note that the Future returned by this method should not complete in normal circumstances but will remain pending forever.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>