e Net::Async::WebSocket::Client;
use IO::Async::SSL;
use URI;
use HTML::Entities ();
use JSON::MaybeXS;
use JSON::MaybeUTF8 qw(:v1);
use curry::weak;
use Log::Any qw($log);
use Variable::Disposition q
ad1 METHODS
=cut
sub bus { shift->{bus} //= Mixin::Event::Dispatch::Bus->new }
sub json { shift->{json} //= JSON::MaybeXS->new( allow_nonref => 1) }
=head2 send_ping
Sends a ping request on this
cut
sub send_ping {
my ($self) = @_;
$self->client->send_frame(
buffer => encode_json_utf8({
event => 'pusher:ping',
data => { }
}),
masked =>
s://pusher.com|Pusher> API.
=cut
use Syntax::Keyword::Try;
use Mixin::Event::Dispatch::Bus;
use JSON::MaybeXS;
use Ryu::Async;
use Log::Any qw($log);
sub configure {
my ($self, %args) = @_;
onfigure(%args);
}
sub bus { shift->{bus} //= Mixin::Event::Dispatch::Bus->new }
sub json { shift->{json} //= JSON::MaybeXS->new( allow_nonref => 1) }
sub ryu { shift->{ryu} }
sub subscribe {
m
{
return $self->subscribed->done
} else {
try {
my $data = $self->json->decode($info->{data});
if(my $bus = $self->{bus}) {
$self->bus->invo