Navigation Menu

Skip to content

Commit

Permalink
Some enhancements to gearman
Browse files Browse the repository at this point in the history
This is some older code, and I can't really guarantee the sanity
of this code, however it Works For Us (TM).

The healthtest module is especially useful
  • Loading branch information
mnunberg committed Aug 13, 2011
1 parent edf9e29 commit 5cc4b71
Show file tree
Hide file tree
Showing 9 changed files with 765 additions and 53 deletions.
9 changes: 4 additions & 5 deletions lib/Gearman/Client.pm
Expand Up @@ -3,12 +3,12 @@
package Gearman::Client;

our $VERSION;
$VERSION = '1.10';
$VERSION = '1.11';

use strict;
use IO::Socket::INET;
use Socket qw(IPPROTO_TCP TCP_NODELAY SOL_SOCKET);

use UNIVERSAL qw(isa);
use Gearman::Objects;
use Gearman::Task;
use Gearman::Taskset;
Expand Down Expand Up @@ -70,7 +70,7 @@ sub _get_task_from_args {
my Gearman::Task $task;
if (ref $_[0]) {
$task = $_[0];
Carp::croak("Argument isn't a Gearman::Task") unless ref $_[0] eq "Gearman::Task";
Carp::croak("Argument isn't a Gearman::Task") unless isa(ref $_[0], "Gearman::Task");
} else {
my ($func, $arg_p, $opts) = @_;
my $argref = ref $arg_p ? $arg_p : \$arg_p;
Expand Down Expand Up @@ -214,8 +214,7 @@ sub _get_js_sock {
my $sock = IO::Socket::INET->new(PeerAddr => $hostport,
Timeout => 1)
or return undef;

setsockopt($sock, IPPROTO_TCP, TCP_NODELAY, pack("l", 1)) or die;
setsockopt($sock, SOL_SOCKET, TCP_NODELAY, pack("l", 1));
$sock->autoflush(1);

# If exceptions support is to be requested, and the request fails, disable
Expand Down

0 comments on commit 5cc4b71

Please sign in to comment.