Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better message and request event examples
  • Loading branch information
kraih committed Oct 29, 2011
1 parent 8b752c5 commit d323417
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.16 2011-10-29 00:00:00
2.16 2011-10-30 00:00:00
- Improved documentation.

2.15 2011-10-29 00:00:00
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Log.pm
Expand Up @@ -125,6 +125,7 @@ L<Mojo::Log> can emit the following events.
Emitted when a new message gets logged.
Note that this event is EXPERIMENTAL and might change without warning!
$log->unsubscribe_all('message');
$log->on(message => sub {
my ($log, $level, @messages) = @_;
say "$level: ", @messages;
Expand Down Expand Up @@ -164,7 +165,7 @@ the following new ones.
my $log = Mojo::Log->new;
Construct a new L<Mojo::Log> object.
Construct a new L<Mojo::Log> object and register default C<message> event.
=head2 C<debug>
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Server.pm
Expand Up @@ -105,6 +105,7 @@ L<Mojo::Server> can emit the following events.
Emitted when a request is ready and needs to be handled.
$server->unsubscribe_all('request');
$server->on(request => sub {
my ($server, $tx) = @_;
$tx->res->code(200);
Expand Down Expand Up @@ -141,7 +142,7 @@ implements the following new ones.
my $server = Mojo::Server->new;
Construct a new L<Mojo::Server> object.
Construct a new L<Mojo::Server> object and register default C<request> event.
=head2 C<build_tx>
Expand Down

0 comments on commit d323417

Please sign in to comment.