Dancer2...nection(3)
π NAME π
Okay bestie, this page is for Dancer2::Plugin::WebSocket::Connection β itβs the role that ties Plack::App::WebSocket::Connection together with the Dancer serializer. Iconic behavior, honestly.
β¨ VERSION β¨
Version 0.3.1 β yes maβam, thatβs the one.
π¦ DESCRIPTION π¦
The connection objects used by Dancer2::Plugin::WebSocket are Plack::App::WebSocket::Connection objects augmented with this role. Thatβs the whole lore.
π Attributes π
serializerβ This is the serializer object used to serialize/deserialize messages. If itβs notundef, then all messages that are notAnyEvent::WebSocket::Messageobjects are assumed to be JSON. Those get deserialized before being passed to the handlers, and they get serialized after being given tosend. Very βglow-up on the way in and on the way outβ of it.idβ A numerical value that is the id of the connection. Numbers only, bestie.
π Methods π
set_channels( @channels )β Set the channels this connection belongs to. Besides the@channelsyou provide, the connection is always associated with its id channel β which is always numerical β and also the global channel"*". She contains multitudes.add_channels( @channels )β Add@channelsto the list of channels the connection belongs to. Just adding to the group chat.in_channel( @channels )β Returns"true"if the connection belongs to at least one of the given@channels. A vibe check for channels, basically.to( @channels )β Returns aDancer2::Plugin::WebSocket::Groupthat will emit messages to all connections belonging to the given@channels. Like so:
$conn->to( 'players' )->send( "game about to begin" );
π AUTHOR π
Yanick Champoux <yanick@cpan.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2021, 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.
And thatβs the whole page, bestie. This little beauty came from the perl v5.42.0 docs, dated 2021-05-31, and itβs the Dancer2...nection(3) manual page. Slay and goodbye πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Dancer2-Plugin-WebSocket 0.3.1-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms