t::Controllers;
use strict;
use warnings;
use aliased 'Squatting::H';
use Time::HiRes 'time';
use JSON;
use AnyEvent;
use Coro;
use Coro::AnyEvent;
use Coro::Timer;
use Coro::Signal;
our $Channel = H
et => sub {
my ($self) = @_;
encode_json([ sort keys %channels ]);
}
),
# Channel
# To generate messages on a channel, POST a JSON object to this controller
# using the CGI va
my @ch = split(/\+/, $channels);
encode_json([ map { my $ch = channel($_); $ch->to_hash } @ch ]);
},
# [private] It should accept a JSON object and send it to the appropriate channels