Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added an example to the README

  • Loading branch information...
commit ca30c063ca0de4de42f8c9a30c349057364e1494 1 parent 8afd531
Timothy Totten authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 README.md
26 README.md
View
@@ -11,6 +11,31 @@ implementation of the FastCGI protocol.
I haven't done any extensive testing using input streams or error streams.
+## Example
+
+Currently the use of the handler() call is required.
+More advanced use, such as with the new SCGI is planned, but will require
+some significant refactoring.
+
+```perl
+use FastCGI;
+
+my $fcgi = FastCGI.new( :port(9119) );
+
+my $handler = sub (%env)
+{
+ my $name = %env<QUERY_STRING> || 'World';
+ my $status = '200';
+ my @headers = 'Content-Type' => 'text/plain';
+ my @body = "Hello $name\n";;
+ return [ $status, @headers, @body ];
+}
+
+$fcgi.handle: $handler;
+```
+
+
+
## Requirements
This requires a Perl 6 implementation that can export constants, and has
@@ -23,6 +48,7 @@ codes supported.
* Rename FastCGI::Protocol to FastCGI::Protocol:PP
* Add FastCGI::Protocol::NativeCall as a wrapper to libfcgi
* Write new FastCGI::Protocol wrapper that uses either PP or NativeCall
+ * Refactor the Connection/Request code to allow for custom request loops.
## Author
Please sign in to comment.
Something went wrong with that request. Please try again.