Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
turn removals into deprecations
  • Loading branch information
kraih committed Feb 17, 2015
1 parent 035611a commit 20c14d5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Changes
@@ -1,8 +1,9 @@

5.80 2015-02-17
- Removed accept_interval, lock and unlock attributes from Mojo::IOLoop.
- Removed accept_interval, lock_file and lock_timeout attributes from
Mojo::Server::Prefork.
- Deprecated Mojo::IOLoop::accept_interval, Mojo::IOLoop::lock and
Mojo::IOLoop::unlock.
- Deprecated Mojo::Server::Prefork::accept_interval,
Mojo::Server::Prefork::lock_file and Mojo::Server::Prefork::lock_timeout.
- Removed -a/--accept-interval, --lock-file and -L/--lock-timeout options
from prefork command.
- Removed accept_interval, lock_file and lock_timeout parameters from
Expand Down
20 changes: 19 additions & 1 deletion lib/Mojo/IOLoop.pm
Expand Up @@ -9,7 +9,7 @@ use Mojo::IOLoop::Delay;
use Mojo::IOLoop::Server;
use Mojo::IOLoop::Stream;
use Mojo::Reactor::Poll;
use Mojo::Util qw(md5_sum steady_time);
use Mojo::Util qw(deprecated md5_sum steady_time);
use Scalar::Util qw(blessed weaken);

use constant DEBUG => $ENV{MOJO_IOLOOP_DEBUG} || 0;
Expand All @@ -29,6 +29,12 @@ $SIG{PIPE} = 'IGNORE';
# Initialize singleton reactor early
__PACKAGE__->singleton->reactor;

# DEPRECATED in Tiger Face!
sub accept_interval {
deprecated 'Mojo::IOLoop::accept_interval is DEPRECATED';
@_ > 1 ? shift : undef;
}

sub acceptor {
my ($self, $acceptor) = (_instance(shift), @_);

Expand Down Expand Up @@ -81,6 +87,12 @@ sub delay {

sub is_running { _instance(shift)->reactor->is_running }

# DEPRECATED in Tiger Face!
sub lock {
deprecated 'Mojo::IOLoop::lock is DEPRECATED';
@_ > 1 ? shift : undef;
}

sub next_tick {
my ($self, $cb) = (_instance(shift), @_);
weaken $self;
Expand Down Expand Up @@ -154,6 +166,12 @@ sub stream {

sub timer { shift->_timer(timer => @_) }

# DEPRECATED in Tiger Face!
sub unlock {
deprecated 'Mojo::IOLoop::unlock is DEPRECATED';
@_ > 1 ? shift : undef;
}

sub _id {
my $self = shift;
my $id;
Expand Down
20 changes: 19 additions & 1 deletion lib/Mojo/Server/Prefork.pm
Expand Up @@ -3,7 +3,7 @@ use Mojo::Base 'Mojo::Server::Daemon';

use File::Spec::Functions qw(catfile tmpdir);
use IO::Poll qw(POLLIN POLLPRI);
use Mojo::Util 'steady_time';
use Mojo::Util qw(deprecated steady_time);
use POSIX 'WNOHANG';
use Scalar::Util 'weaken';
use Time::HiRes ();
Expand All @@ -26,6 +26,12 @@ sub DESTROY {
if (my $file = $self->pid_file) { unlink $file if -w $file }
}

# DEPRECATED in Tiger Face!
sub accept_interval {
deprecated 'Mojo::Server::Prefork::accept_interval is DEPRECATED';
@_ > 1 ? shift : undef;
}

sub check_pid {
my $file = shift->pid_file;
return undef unless open my $handle, '<', $file;
Expand Down Expand Up @@ -58,6 +64,18 @@ sub healthy {
scalar grep { $_->{healthy} } values %{shift->{pool}};
}

# DEPRECATED in Tiger Face!
sub lock_file {
deprecated 'Mojo::Server::Prefork::lock_file is DEPRECATED';
@_ > 1 ? shift : undef;
}

# DEPRECATED in Tiger Face!
sub lock_timeout {
deprecated 'Mojo::Server::Prefork::lock_timeout is DEPRECATED';
@_ > 1 ? shift : undef;
}

sub run {
my $self = shift;

Expand Down
5 changes: 4 additions & 1 deletion t/pod_coverage.t
Expand Up @@ -8,6 +8,9 @@ plan skip_all => 'Test::Pod::Coverage 1.04+ required for this test!'
unless eval 'use Test::Pod::Coverage 1.04; 1';

# DEPRECATED in Tiger Face!
my @tiger = qw(bridge max_connections siblings);
my @tiger = (
qw(accept_interval bridge lock lock_file lock_timeout max_connections),
qw(siblings unlock)
);

all_pod_coverage_ok({also_private => [@tiger]});

0 comments on commit 20c14d5

Please sign in to comment.