The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Async::ControlChannel::Client - IO::Async support for Protocol::ControlChannel.

VERSION

Version 0.005

DESCRIPTION

Provides the client half for a control channel connection.

METHODS

new

Instantiate a new client object.

Expects the following named parameters:

  • loop - the IO::Async::Loop we will attach to

  • host - which host we're connecting to

  • port - the port to connect to

Returns the instance.

loop

The IO::Async::Loop object. Used internally.

proto

The Protocol::ControlChannel instance. Used internally.

connection

A Future which resolves when the connection is established.

start

Connects to the target host, returning a Future which will resolve once the connection is ready (this Future is also available via "connection").

incoming_message

Called internally when we have data from the server.

dispatch

Dispatches the given key, value pair to the remote.

Expects two parameters:

  • $k - a Perl string representing the key we're sending over. Typically this will be 'some.dotted.string'.

  • $v - the value to send over, either a reference or a byte string.

Unicode characters are allowed for the key, but if you want to send non-ASCII text data in the content, it should be encoded explicitly:

 $cc->dispatch("utf₈.is.fine" => Encode::encode('UTF-8' => "ƃuıpoɔuǝ spǝǝu"));

INHERITED METHODS

Mixin::Event::Dispatch

add_handler_for_event, clear_event_handlers, event_handlers, invoke_event, subscribe_to_event, unsubscribe_from_event

AUTHOR

Tom Molesworth <cpan@entitymodel.com>

LICENSE

Copyright Tom Molesworth 2012-2014. Licensed under the same terms as Perl itself.