The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

POE::Component::GCS::Client - Client demo to access GCS server

VERSION

This document describes version 0.01, released Mar, 2007.

SYNOPSIS

Module Synopsis

Create a small script to use this module. The 'gcsClient' command, as shown here, is a complete implementation of this module. Exempli gratia:

#!/opt/perl/bin/perl -T
#
use POE::Component::GCS::Client qw( Text-based );   # use one or the
### POE::Component::GCS::Client qw( Msg-based );    # other, not both

exit( run POE::Component::GCS::Client );        # return status to OS

Command Synopsis

Run the small script, created as shown above, using the '-h' (or '--help') command line option for usage help. To see a list of valid server commands, run script with the 'help' command.

Usage: gcsClient  -h              # show cmd usage and exit
       gcsClient  help            # show list of server commands
       gcsClient [{-r | --raw}] <your added command here>

Test/Debug Synopsis

Usage: gcsClient  ping            # access 'Cmd' service
       gcsClient  sleep <n>       # access 'Task' service
       gcsClient  echo <text>     # access 'Queue/Proc' service
       gcsClient  banner <text>   # access 'Queue/Proc' service
       gcsClient  myCmd <text>    # example of adding custom cmd

These additional commands can be used to access/test/demo various
internal components of the Generic server.

DESCRIPTION

This class is a client interface to the GCS server. This is intended to be implemented via a script named 'gcsClient' and used as a demo of a selectable interface.

There are currently two different interfaces to the GCS server. A Text-based client will use simple text to communicate with the server. A Message-based client can be used to send and receive complex Perl data structures. Either may be used for binary data. If you create a server command that returns binary data, use the '-r' (or '--raw') option with this client command to prevent appending a trailing newline character to the data.

The Text-based client has better performance under volume usage, while the Message-based client allows increased flexibility.

DEPENDENCIES

This script depends upon the following classes:

POE::Component::GCS::ClientMsg     # GCS Msg-based TCP client module
POE::Component::GCS::ClientTxt     # GCS Txt-based TCP client module
POE::Component::GCS::Server::Cfg   # GCS Server configuration module

SEE ALSO

L<POE::Component::GCS::ClientMsg>,
L<POE::Component::GCS::ClientTxt> and
L<POE::Component::GCS::Server>.

AUTHOR

Chris Cobb, <no spam [at] ccobb [dot] net>

COPYRIGHT

Copyright (c) 2007-2010 by Chris Cobb. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.