Skip to content

Commit

Permalink
deprecated Mojo::Transaction::Single
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 5, 2010
1 parent 51e4436 commit e127823
Show file tree
Hide file tree
Showing 19 changed files with 692 additions and 652 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -8,6 +8,8 @@ This file documents the revision history for Perl extension Mojo.
- Deprecated $VERSION in Mojo, new $VERSION lives in Mojolicious.
Make sure to update your modules depending on Mojo to depend on
Mojolicious in the future.
- Deprecated Mojo::Transaction::Single, make sure to update all old
code to use Mojo::Transaction::HTTP instead.
- MOJO_RELOAD=1 now works with Mojolicious::Lite, have fun!
- Allow reloading to be triggered once by a USR1 signal.
- Added --reload flag to all server bindings as an alternative to
Expand Down
7 changes: 4 additions & 3 deletions lib/Mojo.pm
Expand Up @@ -12,13 +12,13 @@ use Mojo::Client;
use Mojo::Commands;
use Mojo::Home;
use Mojo::Log;
use Mojo::Transaction::Single;
use Mojo::Transaction::HTTP;
use Mojo::Transaction::WebSocket;

__PACKAGE__->attr(
build_tx_cb => sub {
sub {
my $tx = Mojo::Transaction::Single->new;
my $tx = Mojo::Transaction::HTTP->new;
$tx->res->headers->header('X-Powered-By' => 'Mojo (Perl)');
return $tx;
}
Expand Down Expand Up @@ -50,6 +50,7 @@ __PACKAGE__->attr(
);

# DEPRECATED in Snowman!
# Use $Mojolicious::VERSION instead.
our $VERSION = '0.999920';

# Oh, so they have internet on computers now!
Expand Down Expand Up @@ -129,7 +130,7 @@ L<Mojo> implements the following attributes.
$mojo = $mojo->build_tx_cb(sub { ... });
The transaction builder callback, by default it builds a
L<Mojo::Transaction::Single> object.
L<Mojo::Transaction::HTTP> object.
=head2 C<client>
Expand Down
13 changes: 6 additions & 7 deletions lib/Mojo/Client.pm
Expand Up @@ -16,7 +16,7 @@ use Mojo::CookieJar;
use Mojo::IOLoop;
use Mojo::Parameters;
use Mojo::Server::Daemon;
use Mojo::Transaction::Single;
use Mojo::Transaction::HTTP;
use Mojo::Transaction::WebSocket;
use Scalar::Util 'weaken';

Expand Down Expand Up @@ -134,7 +134,7 @@ sub post_form {
}

# Transaction
my $tx = Mojo::Transaction::Single->new;
my $tx = Mojo::Transaction::HTTP->new;
$tx->req->method('POST');
$tx->req->url->parse($url);

Expand Down Expand Up @@ -261,7 +261,7 @@ sub websocket {
my $self = shift;

# New WebSocket
my $tx = Mojo::Transaction::Single->new;
my $tx = Mojo::Transaction::HTTP->new;

# Request
my $req = $tx->req;
Expand Down Expand Up @@ -337,7 +337,7 @@ sub _build_tx {
my $self = shift;

# New transaction
my $tx = Mojo::Transaction::Single->new;
my $tx = Mojo::Transaction::HTTP->new;

# Request
my $req = $tx->req;
Expand Down Expand Up @@ -724,7 +724,7 @@ sub _redirect {
return unless $r < $max;

# New transaction
my $new = Mojo::Transaction::Single->new;
my $new = Mojo::Transaction::HTTP->new;
$new->req->method($method);
$new->req->url->parse($location);

Expand Down Expand Up @@ -938,8 +938,7 @@ with C<IPv6>, C<TLS>, C<epoll> and C<kqueue> support.
It implements the most common HTTP verbs.
If you need something more custom you can create your own
L<Mojo::Transaction::Single> or L<Mojo::Trasaction::Pipeline> objects and
C<queue> them.
L<Mojo::Transaction::HTTP> objects and C<queue> them.
All of the verbs take an optional set of headers as a hash or hash reference,
as well as an optional callback sub reference.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Command/Get.pm
Expand Up @@ -9,7 +9,7 @@ use base 'Mojo::Command';

use Mojo::ByteStream 'b';
use Mojo::Client;
use Mojo::Transaction::Single;
use Mojo::Transaction::HTTP;

use Getopt::Long 'GetOptions';

Expand Down Expand Up @@ -45,7 +45,7 @@ sub run {
unless $url =~ /^\w+:\/\//;

# Transaction
my $tx = Mojo::Transaction::Single->new;
my $tx = Mojo::Transaction::HTTP->new;
$tx->req->method('GET');
$tx->req->url->parse($url);
$tx->res->body(
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/HelloWorld.pm
Expand Up @@ -229,11 +229,11 @@ Mojo::HelloWorld - Hello World!
=head1 SYNOPSIS
use Mojo::Transaction::Single;
use Mojo::Transaction::HTTP;
use Mojo::HelloWorld;
my $hello = Mojo::HelloWorld->new;
my $tx = $hello->handler(Mojo::Transaction::Single->new);
my $tx = $hello->handler(Mojo::Transaction::HTTP->new);
=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server.pm
Expand Up @@ -140,7 +140,7 @@ L<Mojo::Server> implements the following attributes.
my $btx = $server->build_tx_cb;
$server = $server->build_tx_cb(sub {
my $self = shift;
return Mojo::Transaction::Single->new;
return Mojo::Transaction::HTTP->new;
});
=head2 C<continue_handler_cb>
Expand Down

0 comments on commit e127823

Please sign in to comment.