Plack::App::EventSource::Connection - Connection object
Used internally by Plack::App::EventSource.
This is a connection object that you get in handler_cb callback.
handler_cb
new
Creates new object.
close
Closes connection.
push
Pushes data to the client. Accepts an array of messages, which themselves can be strings or hash references.
$conn->push('message'); $conn->push('multi', 'line', 'message'); $conn->push({id => 1, data => 'message with id'});
possible hash fields are event, id, data, and retry.
event
id
data
retry
Viacheslav Tykhanovskyi, <viacheslav.t@gmail.com>
Copyright (C) 2015-, Viacheslav Tykhanovskyi
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install Plack::App::EventSource, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::App::EventSource
CPAN shell
perl -MCPAN -e shell install Plack::App::EventSource
For more information on module installation, please visit the detailed CPAN module installation guide.