Skip to content

Commit

Permalink
removed handler method again from Mojo::Server
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 27, 2011
1 parent 6b463c1 commit d8adc8c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
1 change: 0 additions & 1 deletion Changes
Expand Up @@ -3,7 +3,6 @@ This file documents the revision history for Perl extension Mojolicious.
2.12 2011-10-27 00:00:00
- Added EXPERIMENTAL cleanup_interval attribute to Mojo::IOLoop.
- Added EXPERIMENTAL max_leftover_size attribute to Mojo::Content.
- Added EXPERIMENTAL handler method to Mojo::Server.
- Replaced handle method in Mojo::IOLoop with stream method.
- Replaced writing and not_writing methods in Mojo::IOWatcher with
watch method.
Expand Down
13 changes: 2 additions & 11 deletions lib/Mojo/Server.pm
Expand Up @@ -23,8 +23,6 @@ sub new {

sub build_tx { shift->app->build_tx }

sub handler { shift->emit(request => @_) }

sub load_app {
my ($self, $file) = @_;

Expand Down Expand Up @@ -88,8 +86,8 @@ Mojo::Server - HTTP server base class
# Get a transaction
my $tx = $self->build_tx;
# Handle request
$self->handler($tx);
# Emit "request" event
$self->emit(request => $tx);
}
=head1 DESCRIPTION
Expand Down Expand Up @@ -152,13 +150,6 @@ Construct a new L<Mojo::Server> object.
Let application build a transaction.
=head2 C<handler>
$server->handler($tx);
Emit C<request> event.
Note that this method is EXPERIMENTAL and might change without warning!
=head2 C<load_app>
my $app = $server->load_app('./myapp.pl');
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/CGI.pm
Expand Up @@ -29,7 +29,7 @@ sub run {
}

# Handle
$self->handler($tx);
$self->emit(request => $tx);

# Response start line
STDOUT->autoflush(1);
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -115,11 +115,11 @@ sub _build_tx {
# WebSocket
if ($ws) {
$self->{connections}->{$id}->{websocket} = $ws->server_handshake;
$self->handler($ws);
$self->emit(request => $ws);
}

# HTTP
$self->handler($tx);
$self->emit(request => $tx);

# Resume
$tx->on(resume => sub { $self->_write($id) });
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/PSGI.pm
Expand Up @@ -31,7 +31,7 @@ sub run {
}

# Handle
$self->handler($tx);
$self->emit(request => $tx);

# Response headers
my $res = $tx->res;
Expand Down

0 comments on commit d8adc8c

Please sign in to comment.