NAME

Argon::Channel - Line protocol API for non-blocking sockets

VERSION

version 0.18

SYNOPSIS

  my $ch = Argon::Channel->new(
    fh => $socket,
    on_msg => sub {...},
    on_close => sub {...},
    on_err => sub {...}
  );

  $ch->send(Argon::Message->new(...));

DESCRIPTION

Internal class implementing the line protocol API used for non-blocking socket connections.

ATTRIBUTES

fh

File handle for the connected socket. Assumed to be non-blocking.

on_msg

A code ref that is called when a new Argon::Message arrives. The message is passed as the only argument.

on_close

A code ref that is called when the connection is closed.

on_err

A code ref that is called when an error occurs during socket communication. The error message is passed as the only argument.

METHODS

send

Sends an Argon::Message over the socket.

AUTHOR

Jeff Ober <sysread@fastmail.fm>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Jeff Ober.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.