Skip to content

Commit

Permalink
better synopsis examples for transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 13, 2012
1 parent e6634f3 commit 6ec08a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@

3.30 2012-08-14
- Added te method to Mojo::Headers.
- Improved documentation.
- Fixed small content encoding bug in Mojo::Message.

3.29 2012-08-13
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojo/Transaction/HTTP.pm
Expand Up @@ -242,12 +242,14 @@ Mojo::Transaction::HTTP - HTTP transaction
say $tx->res->code;
say $tx->res->headers->content_type;
say $tx->res->body;
say $tx->remote_address;
# Server
my $tx = Mojo::Transaction::HTTP->new;
say $tx->req->method;
say $tx->req->url->to_abs;
say $tx->req->headers->accept;
say $tx->remote_address;
$tx->res->code(200);
$tx->res->headers->content_type('text/plain');
$tx->res->body('Hello World!');
Expand Down
4 changes: 4 additions & 0 deletions lib/Mojo/Transaction/WebSocket.pm
Expand Up @@ -314,6 +314,10 @@ Mojo::Transaction::WebSocket - WebSocket transaction
my ($ws, $message) = @_;
say "Message: $message";
});
$ws->on(finish => sub {
my $ws = shift;
say 'WebSocket closed.';
});
=head1 DESCRIPTION
Expand Down

0 comments on commit 6ec08a7

Please sign in to comment.