Skip to content

Commit

Permalink
synopsis rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
mindc committed May 13, 2016
1 parent 194a6fc commit 9252132
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ C<Plack::App::Net::Async::WebSocket> - serve WebSocket clients using C<IO::Async
}
)->to_app;


# using Plack::Builder

use Plack::Builder;
use Plack::App::Net::Async::WebSocket;

builder {
mount '/websocket' => Plack::App::Net::Async::WebSocket->new(
on_frame => sub {
my ( $websocket, $frame ) = @_;
$websocket->send_frame( $frame ); # echo
},
);
};


=head1 DESCRIPTION

This subclass of L<Plack::Component> accepts WebSocket connections. When a
Expand Down
16 changes: 16 additions & 0 deletions lib/Plack/App/Net/Async/WebSocket.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@ C<Plack::App::Net::Async::WebSocket> - serve WebSocket clients using C<IO::Async
}
)->to_app;
# using Plack::Builder
use Plack::Builder;
use Plack::App::Net::Async::WebSocket;
builder {
mount '/websocket' => Plack::App::Net::Async::WebSocket->new(
on_frame => sub {
my ( $websocket, $frame ) = @_;
$websocket->send_frame( $frame ); # echo
},
);
};
=head1 DESCRIPTION
This subclass of L<Plack::Component> accepts WebSocket connections. When a
Expand Down

0 comments on commit 9252132

Please sign in to comment.