summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-09-15 11:20:38 +0200
committerfranck cuny <franck@lumberjaph.net>2010-09-15 11:20:38 +0200
commit8b516ec0a46f87154fa7b93e656adf891f673409 (patch)
tree5ee4b5a5340d32af195e702b29ec240347bc6743
parentauths mw extends auth (diff)
downloadnet-http-spore-8b516ec0a46f87154fa7b93e656adf891f673409.tar.gz
POD for mw runtime
-rw-r--r--lib/Net/HTTP/Spore/Middleware/Runtime.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Spore/Middleware/Runtime.pm b/lib/Net/HTTP/Spore/Middleware/Runtime.pm
index 1614c31..1efcb53 100644
--- a/lib/Net/HTTP/Spore/Middleware/Runtime.pm
+++ b/lib/Net/HTTP/Spore/Middleware/Runtime.pm
@@ -1,5 +1,7 @@
 package Net::HTTP::Spore::Middleware::Runtime;
 
+# ABSTRACT: add a new header with runtime
+
 use Moose;
 extends 'Net::HTTP::Spore::Middleware';
 use Time::HiRes;
@@ -20,3 +22,15 @@ sub call {
 }
 
 1;
+
+=head1 SYNOPSIS
+
+    my $client = Net::HTTP::Spore->new_from_spec('twitter.json');
+    $client->enable('Runtime');
+
+    my $result = $client->public_timeline;
+    say "request executed in ".$result->header('X-Spore-Runtime');
+
+=head1 DESCRIPTION
+
+Net::HTTP::Spore::Middleware::Runtime is a middleware that add a new header to the response's headers: X-Spore-Runtime. The value of the header is the time the request took to be executed.