From: Tyler Riddle Date: Mon, 17 Dec 2012 18:20:37 +0000 (-0800) Subject: update Object::Remote::connect() to pass arguments to the connection X-Git-Tag: v0.003001_01~26 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=commitdiff_plain;h=7108761014aa075f45d64a59afe0c2d0ba856f63 update Object::Remote::connect() to pass arguments to the connection --- diff --git a/lib/Object/Remote.pm b/lib/Object/Remote.pm index 55b6b59..f937fb3 100644 --- a/lib/Object/Remote.pm +++ b/lib/Object/Remote.pm @@ -27,8 +27,8 @@ sub new { } sub connect { - my ($class, $to) = @_; - use_module('Object::Remote::Connection')->maybe::start::new_from_spec($to); + my ($class, $to, @args) = @_; + use_module('Object::Remote::Connection')->maybe::start::new_from_spec($to, @args); } sub current_loop { diff --git a/lib/Object/Remote/Connection.pm b/lib/Object/Remote/Connection.pm index 5d4f4b6..e6a5a98 100644 --- a/lib/Object/Remote/Connection.pm +++ b/lib/Object/Remote/Connection.pm @@ -236,9 +236,9 @@ sub conn_from_spec { } sub new_from_spec { - my ($class, $spec) = @_; + my ($class, $spec, @args) = @_; return $spec if blessed $spec; - my $conn = $class->conn_from_spec($spec); + my $conn = $class->conn_from_spec($spec, @args); die "Couldn't figure out what to do with ${spec}" unless defined $conn; diff --git a/t/watchdog.t b/t/watchdog.t index ca00170..e6f036b 100644 --- a/t/watchdog.t +++ b/t/watchdog.t @@ -8,7 +8,7 @@ use Object::Remote::FromData; $SIG{ALRM} = sub { fail("Watchdog killed remote process in time"); die "test failed" }; -my $conn = Object::Remote::Connection->conn_from_spec("-", watchdog_timeout => 1)->connect; +my $conn = Object::Remote->connect("-", watchdog_timeout => 1); my $remote = HangClass->new::on($conn);