|
NAMEAmon2::Plugin::Web::Streaming - streaming support for Amon2 SYNOPSIS use Amon2::Lite;
__PACKAGE__->load_plugin(qw/Web::Streaming/);
any '/poll' => sub {
my $c = shift;
return $c->streaming(sub {
my $respond = shift;
...;
$respond->write([200, [], ['OK']]);
});
};
any '/poll_json' => sub {
my $c = shift;
return $c->streaming_json(sub {
my $writer = shift;
...;
$writer->write_json(+{ });
$writer->close;
});
};
DESCRIPTIONThis is an Amon2 plugin to support streaming. You MUST use the HTTP server supporting psgi.streaming. EXPORTED METHODS
Amon2::Plugin::Streaming::Writer METHODS
SEE ALSOPSGI
|