From: Matt S Trout Date: Tue, 29 Nov 2011 21:34:11 +0000 (+0000) Subject: make Client look like a Service X-Git-Tag: v0.001002~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bebc6313120336a47c1db4fe036f8f047a23caa3;p=scpubgit%2FTak.git make Client look like a Service --- diff --git a/lib/Tak/Client.pm b/lib/Tak/Client.pm index 949e9af..e8f7d60 100644 --- a/lib/Tak/Client.pm +++ b/lib/Tak/Client.pm @@ -13,7 +13,9 @@ sub curry { (ref $self)->new(%$self, curried => [ @{$self->curried}, @curry ]); } -sub send { +sub send { shift->receive(@_) } + +sub receive { my ($self, @message) = @_; $self->service->receive(@{$self->curried}, @message); } @@ -21,10 +23,15 @@ sub send { sub start { my ($self, $register, @payload) = @_; my $req = $self->_new_request($register); - $self->service->start_request($req, @{$self->curried}, @payload); + $self->start_request($req, @payload); return $req; } +sub start_request { + my ($self, $req, @payload) = @_; + $self->service->start_request($req, @{$self->curried}, @payload); +} + sub request_class { 'Tak::Request' } sub _new_request {