GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GUNGHO::INLINE (3)

.ds Aq ’

NAME

Gungho::Inline - Inline Your Providers And Handlers (Deprecated)

CONTENTS

SYNOPSIS



  use Gungho::Inline;
  use IO::Select;
 
  Gungho::Inline->run(
     $config,
     {
        provider => sub {
           my ($provider, $c) = @_;
           while (IO::Select->new(STDIN)->can_read(0)) {
              return if STDIN->eof;
              my $url = STDIN->getline;
              chomp $url;
              $provider->add_request($c->prepare_request(Gungho::Request->new(GET => $url)));
            }
        },
        handler => sub {
           my ($handler, $c, $req, $res) = @_;
           print $res->code,  , $req->uri, "\n";
        }
    }
  );



DESCRIPTION

Sometimes you don’t need the full power of an independent Gungho Provider and or Handler. In those cases, Gungho::Inline saves you from creating separate packages

This module is a thin wrapper around Gungho that allows you to specify subroutine references instead of a full config.

As of Gungho 0.09003, inlined handlers and providers are supported natively. The only reason to use this module is for you to use the old parameter list.

BACKWARDS COMPATIBILITY WITH VERSIONS < 0.08

From version 0.08 of Gungho::Inline, the parameter list passed to the handler and providers, as well as the run method has been changed. You can enable the old behavior if you do



   env GUNGHO_INLINE_OLD_PARAMETER_LIST=1 gungho



or, somewhere in your code, create a subroutine constant:



   BEGIN
   {
       sub Gungho::Inline::OLD_PARAMETER_LIST { 1 };
   }
   use Gungho::Inline;



CONSTANTS

    OLD_PARAMETER_LIST

If true, uses the old-style parameter list

METHODS

setup({ provider => CW$callback, handler => CW$callback, CW%args })

Sets up Gungho::Inline with this set of providers

AUTHOR

Original code by Kazuho Oku.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GUNGHO::INLINE (3) 2008-01-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.