switch Request to invocant + method, clean up Remote using a coderef method
[scpubgit/Tak.git] / lib / Tak / Request.pm
index 669e027..2ba8262 100644 (file)
@@ -6,9 +6,11 @@ has tag => (is => 'ro', required => 1);
 
 has respond_to => (is => 'ro', required => 1, weak_ref => 1);
 
+has respond_with => (is => 'ro', required => 1);
+
 sub respond {
   my $self = shift;
-  $self->respond_to->send_response($self->tag => @_);
+  $self->respond_to->${\$self->respond_with}($self->tag => @_);
 }
 
 1;