NAME

Clio::Server::ClientsManager - Clients manager

VERSION

version 0.02

DESCRIPTION

Clients manager is created by Clio::Server to manage incoming connections.

Class used to create new client object is set by configuration key, eg:

    <Server>
        Class TCP
        <Client>
            Class Handle
            ...
        </Client>
    </Server>

would use Clio::Server::TCP::Client::Handle.

Consumes the Clio::Role::HasContext.

ATTRIBUTES

clients

    while ( my ($id, $client) = each %{ $clients_manager->clients } ) {
        print $client->write("Welcome client $id");
    }

All managed clients.

METHODS

new_client

    my $client = $client_manager->new_client(
        id => $uuid,
        %class_specific_args
    );

Creates new managed client. Arguments are specific to the class.

disconnect_client

    $client_manager->disconnect_client( $client->id );

Disconnects client.

total_count

    my $connected_clients = $clients_manager->total_count;

Total number of connected clients.

AUTHOR

Alex J. G. Burzyński <ajgb@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Alex J. G. Burzyński <ajgb@cpan.org>.

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