Skip to content

Commit

Permalink
better event descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 19, 2011
1 parent 75055cb commit 77adeb4
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,5 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.

2.02 2011-10-20 00:00:00
- Improved documentation.

2.01 2011-10-19 00:00:00
- Added EXPERIMENTAL upgrade event to Mojo::Content::Single.
- Added EXPERIMENTAL part event to Mojo::Content::MultiPart.
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojo/Content.pm
Expand Up @@ -444,7 +444,7 @@ L<Mojo::Content> can emit the following events.
my $content = shift;
});
Emitted once all headers have been parsed and the content starts.
Emitted once all headers have been parsed and the body starts.
Note that this event is EXPERIMENTAL and might change without warning!
=head2 C<read>
Expand All @@ -453,7 +453,8 @@ Note that this event is EXPERIMENTAL and might change without warning!
my ($content, $chunk) = @_;
});
Emitted when new content arrives.
Emitted when a new chunk of content arrives, also disables normal content
storage in asset objects.
=head1 ATTRIBUTES
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Content/MultiPart.pm
Expand Up @@ -258,10 +258,10 @@ emit the following new ones.
=head2 C<part>
$multi->on(part => sub {
my ($multi, $part) = @_;
my ($multi, $single) = @_;
});
Emitted when a new part starts.
Emitted when a new L<Mojo::Content::Single> part starts.
Note that this event is EXPERIMENTAL and might change without warning!
=head1 ATTRIBUTES
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Content/Single.pm
Expand Up @@ -107,7 +107,7 @@ emit the following new ones.
my ($single, $multi) = @_;
});
Emitted when content gets upgraded.
Emitted when content gets upgraded to a L<Mojo::Content::MultiPart> object.
Note that this event is EXPERIMENTAL and might change without warning!
=head1 ATTRIBUTES
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Message.pm
Expand Up @@ -574,7 +574,7 @@ Emitted after message building or parsing is finished.
my $message = shift;
});
Emitted on progress.
Emitted when message building or parsing makes progress.
=head1 ATTRIBUTES
Expand Down
12 changes: 6 additions & 6 deletions lib/Mojo/Transaction/HTTP.pm
Expand Up @@ -185,9 +185,9 @@ sub server_read {

# EOF
elsif ((length $chunk == 0) || ($req->is_done && !$self->{handled}++)) {
my $ws = $self;
$self->emit(upgrade => $ws) if $req->headers->upgrade;
$self->emit(request => $ws);
my $upgraded = $self;
$self->emit(upgrade => $upgraded) if $req->headers->upgrade;
$self->emit(request => $upgraded);
}

# Expect 100 Continue
Expand Down Expand Up @@ -345,15 +345,15 @@ can emit the following new ones.
my ($tx, $upgraded) = @_;
});
Emitted when a request needs to be handled.
Emitted when a request is ready and needs to be handled.
=head2 C<upgrade>
$tx->on(upgrade => sub {
my ($tx, $ws) = @_;
my ($tx, $upgraded) = @_;
});
Emitted when a connection needs to be upgraded.
Emitted when the transaction can be upgraded.
=head1 ATTRIBUTES
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Transaction/WebSocket.pm
Expand Up @@ -375,7 +375,7 @@ and can emit the following new ones.
my ($ws, $message) = @_;
});
Emitted when a new message arrives.
Emitted when a new WebSocket message arrives.
=head1 ATTRIBUTES
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -35,7 +35,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Leaf Fluttering In Wind';
our $VERSION = '2.01';
our $VERSION = '2.02';

# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
Expand Down

0 comments on commit 77adeb4

Please sign in to comment.