App-screenorama
view release on metacpan or search on metacpan
script/screenorama view on Meta::CPAN
484950515253545556575859606162636465666768
$plugins
->on(
output
=>
$cb
);
$c
->on(
finish
=>
sub
{
$plugins
->unsubscribe(
output
=>
$cb
); });
$c
->
send
({
json
=>
$last
})
if
$last
;
};
}
else
{
websocket
'/stream'
=>
sub
{
my
$c
=
shift
;
my
$fork
= _start_application(
$c
);
Scalar::Util::weaken(
$c
);
$c
->on(
finish
=>
sub
{
$fork
->
kill
(
$config
->{kill_signal});
undef
$fork
; });
$fork
->on(
close
=>
sub
{
$c
->
send
({
json
=> {
exit_value
=>
$_
[1],
signal
=>
$_
[2]}})->finish });
$fork
->on(
error
=>
sub
{
$c
->
send
({
json
=> {
error
=>
$_
[1]}})->finish });
$fork
->on(
read
=>
sub
{
$c
->
send
({
json
=> {
output
=>
$_
[1]}}) });
};
}
app->start;
#=============================================================================
( run in 0.265 second using v1.01-cache-2.11-cpan-94b05bcf43c )