Dancer2::Plugin::WebSocket::Connection - Role tying Plack::App::WebSocket::Connection with the Dancer serializer
version 0.1.2
The connection objects used by Dancer2::Plugin::WebSocket are Plack::App::WebSocket::Connection objects augmented with this role.
Serializer object used to serialize/deserialize messages. If it's not undef, all messages that are not AnyEvent::WebSocket::Message objects are assumed to be JSON and will be deserialized before being passed to the handlers, and will be serialized after being give to send.
undef
send
A numerical value that is the id of the connection.
Set the channels this connection belongs to. In addition to the @channels provided, the connection is always associated to its id channel (which is always numerical) as well as the global channel *.
@channels
*
Add @channels to the list of channels the connection belongs to.
Returns true if the connection belongs to at least one of the given @channels.
true
Returns a Dancer2::Plugin::WebSocket::Group that will emit messages to all connections belonging to the given @channels.
$conn->to( 'players' )->send( "game about to begin" );
Yanick Champoux <yanick@cpan.org>
This software is copyright (c) 2019, 2017 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
4 POD Errors
The following errors were encountered while parsing the POD:
=over should be: '=over' or '=over positive_number'
You can't have =items (as at line 113) unless the first thing after the =over is an =item
You forgot a '=back' before '=head2'
You forgot a '=back' before '=head1'
To install Dancer2::Plugin::WebSocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2::Plugin::WebSocket
CPAN shell
perl -MCPAN -e shell install Dancer2::Plugin::WebSocket
For more information on module installation, please visit the detailed CPAN module installation guide.