Tangence::Server - mixin class for building a Tangence server
Tangence::Server
Tangence
This class is a mixin, it cannot be directly constructed
package Example::Server; use base qw( Base::Server Tangence::Server ); sub new { my $class = shift; my %args = @_; my $registry = delete $args{registry}; my $self = $class->SUPER::new( %args ); $self->registry( $registry ); return $self; } sub tangence_write { my $self = shift; $self->write( $_[0] ); } sub on_read { my $self = shift; $self->tangence_readfrom( $_[0] ); }
This module provides mixin to implement a Tangence server connection. It should be mixed in to an object used to represent a single connection from a client. It provides a location for the objects in server to store information about the client connection, and coordinates passing messages between the client and the objects in the server.
This is a subclass of Tangence::Stream which provides implementations of the required handle_request_ methods. A class mixing in Tangence::Server must still provide the write method required for sending data to the client.
handle_request_
write
For an example of a class that uses this mixin, see Net::Async::Tangence::ServerProtocol.
The following methods are provided by this mixin.
Accessor to set or obtain the Tangence::Registry object for the server.
Paul Evans <leonerd@leonerd.org.uk>
To install Tangence, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tangence
CPAN shell
perl -MCPAN -e shell install Tangence
For more information on module installation, please visit the detailed CPAN module installation guide.