NAME
Continuity::REPL - Use a Devel::REPL on a Continuity server
SYNOPSYS
use strict;
use Continuity;
use Continuity::REPL;
use vars qw( $repl $server );
$repl = Continuity::REPL->new;
$server = Continuity->new( port => 8080 );
$server->loop;
sub main {
my $request = shift;
my $count = 0;
while(1) {
$count++;
$request->print("Count: $count");
$request->next;
}
}
The command line interaction looks like this:
main:001:0> $server
$Continuity1 = Continuity=HASH(0x86468c8);
main:002:0> $server->{mapper}->{sessions}
$HASH1 = {
19392613106888830468 => Coro::Channel=ARRAY(0x8d82038),
58979072056380208100 => Coro::Channel=ARRAY(0x8d78890)
};
main:003:0> Coro::State::list()
$ARRAY1 = [
Coro=HASH(0x8d82208),
Coro=HASH(0x8d78aa0),
Coro=HASH(0x8d38b98),
Coro=HASH(0x8d38a38),
Coro=HASH(0x8b99248),
Coro=HASH(0x825d6c8),
Coro=HASH(0x81d7568),
Coro=HASH(0x81d7518),
Coro=HASH(0x81d7448)
];
DESCRIPTION
This provides a Devel::REPL shell for Continuity applications.
For now it is just amusing, but it will become useful once it can run the shell within the context of individual sessions. Then it might be a nice diagnostic or perhaps even development tool. Heck... maybe we can throw in a web interface to it...
Also, this library forces the PERL_RL environment variable to 'Perl' since I haven't been able to figure out how to hack Term::ReadLine::Gnu yet.
METHODS
$c_repl = Continuity::REPL->new( repl => $repl );
Create and start a new REPL on the command line. Optionally pass your own Devel::REPL object. If you don't pass in $repl, a default is created.
default_repl
This internal method creates the default REPL if one isn't specified.
SEE ALSO
Continuity, Devel::REPL, Coro::Debug
AUTHOR
Brock Wilcox <awwaiid@thelackthereof.org> - http://thelackthereof.org/
COPYRIGHT
Copyright (c) 2008 Brock Wilcox <awwaiid@thelackthereof.org>. All rights
reserved. This program is free software; you can redistribute it and/or modify
it under the same terms as Perl 5.10 or later.