View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Paul Evans > Tangence > Tangence::Client



Annotate this POD


New  2
Open  0
View/Report Bugs
Module Version: 0.24   Source  


Tangence::Client - mixin class for building a Tangence client


This class is a mixin, it cannot be directly constructed

 package Example::Client;
 use base qw( Base::Client Tangence::Client );

 sub connect
    my $self = shift;
    $self->SUPER::connect( @_ );


    wait_for { defined $self->rootobj };

 sub tangence_write
    my $self = shift;
    $self->write( $_[0] );

 sub on_read
    my $self = shift;
    $self->tangence_readfrom( $_[0] );

 package main;

 my $client = Example::Client->new;
 $client->connect( "" );

 my $rootobj = $client->rootobj;


This module provides mixin to implement a Tangence client connection. It should be mixed in to an object used to represent a single connection to a server. It provides a central location in the client to store object proxies, including to the root object and the registry, and coordinates passing messages between the server and the object proxies it contains.

This is a subclass of Tangence::Stream which provides implementations of the required handle_request_ methods. A class mixing in Tangence::Client must still provide the tangence_write method required for sending data to the server.

For an example of a class that uses this mixin, see Net::Async::Tangence::Client.


The following methods are provided by this mixin.


   $rootobj = $client->rootobj

Returns a Tangence::ObjectProxy to the server's root object


   $registry = $client->registry

Returns a Tangence::ObjectProxy to the server's object registry


   $client->tangence_connected( %args )

Once the base connection to the server has been established, this method should be called to perform the initial work of requesting the root object and the registry.

It takes the following named arguments:

do_init => BOOL

Ignored. Maintained for compatibility with previous version that allowed this to be disabled.

on_root => CODE

Optional callback to be invoked once the root object has been returned. It will be passed a Tangence::ObjectProxy to the root object.

 $on_root->( $rootobj )
on_registry => CODE

Optional callback to be invoked once the registry has been returned. It will be passed a Tangence::ObjectProxy to the registry.

 $on_registry->( $registry )
version_minor_min => INT

Optional minimum minor version to negotiate with the server. This can be used to require a higher minimum version than the client module itself supports, in case the application requires features in a newer version than that.


These methods are intended for implementation classes to override.


   $f = $client->new_future

Returns a new Future instance for basing asynchronous operations on.


Paul Evans <>

syntax highlighting: