switch Request to invocant + method, clean up Remote using a coderef method
[scpubgit/Tak.git] / lib / Tak / Router.pm
index 214455c..d48f28b 100644 (file)
@@ -65,7 +65,7 @@ sub receive_request {
   my $request
     = $self->requests_received->{$tag}
     = Tak::Request->new(
-        tag => $tag, respond_to => $self
+        tag => $tag, respond_to => $self, respond_with => 'send_response',
       );
   $handler->start_request($request => @payload);
 }
@@ -77,13 +77,14 @@ sub send_response {
 }
 
 sub send_request {
-  my ($self, $respond_to, @payload) = @_;
+  my ($self, $respond_to, $respond_with, @payload) = @_;
   my $tag = $self->next_serial;
   my $request
     = $self->requests_sent->{$tag}
     = Tak::Request->new(
         tag => $tag,
-        respond_to => $respond_to
+        respond_to => $respond_to,
+        respond_with => $respond_with,
       );
   $self->channel->send(REQUEST => $tag => @payload);
   return $request;