.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Xango::Broker::Base 3" .TH Xango::Broker::Base 3 "2008-01-18" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Xango::Broker::Base \- Base Class for Xango Broker .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& package MyBroker; \& use strict; \& use base qw(Xango::Broker::Base); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Xango::Broker::Base implements the common broker methods. .PP You should be using Xango::Broker::Pull or Xango::Broker::Push in your applications. See respective documentations. .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .Sh "spawn(%args)" .IX Subsection "spawn(%args)" Create a new Xango::Broker::Base object, and also spawn a new POE::Session using that new object. To start a Xango::Broker session, you should be using \&\fIspawn()\fR, and not \fInew()\fR. .PP Accepts the same arguments as \fInew()\fR. .Sh "new(%args)" .IX Subsection "new(%args)" Create a new Xango::Broker::Base object. Arguments passed to it are stored via \fIinitialize()\fR .IP "Alias (scalar)" 4 .IX Item "Alias (scalar)" The \s-1POE\s0 session alias for the broker. .IP "ConfigFile (scalar)" 4 .IX Item "ConfigFile (scalar)" Path to the config file used by Xango::Config. Values in this file will be used as the default value for other variables. .IP "EnableDnsCache" 4 .IX Item "EnableDnsCache" Flag to tell Xango if \s-1DNS\s0 caching should be used. By default it's on. Turn this off for short-running Xango process that want to avoid repeated \s-1DNS\s0 failures caused by a cached \s-1DNS\s0 query failure. .IP "DnsCacheClass (scalar)" 4 .IX Item "DnsCacheClass (scalar)" Perl class to use for \s-1DNS\s0 cache. .IP "DnsCacheArgs (hashref | arrayref)" 4 .IX Item "DnsCacheArgs (hashref | arrayref)" Arguments to the \s-1DNS\s0 cache constructor .IP "DnsCacheArgsDeref (boolean)" 4 .IX Item "DnsCacheArgsDeref (boolean)" Try to de-reference the \s-1DNS\s0 cache constructor argument specified by DnsCacheArgs when creating the cache. This is required if your \s-1DNS\s0 cache class uses simple list values instead of hash/array refs (e.g. Cache::Cache and Cache::FastMmap) .IP "DnsCompClass (scalar)" 4 .IX Item "DnsCompClass (scalar)" Specify the \s-1POE\s0 component class to asynchronously resolve \s-1DNS\s0 requests. By default POE::Component::Client::DNS is used. .IP "HandlerAlias (scalar)" 4 .IX Item "HandlerAlias (scalar)" The \s-1POE\s0 session alias for the handler. .IP "HttpCompClass (scalar)" 4 .IX Item "HttpCompClass (scalar)" Specify the \s-1POE\s0 component class to handle the actual \s-1HTTP\s0 fetching. By default POE::Component::Client::HTTP is used. .IP "HttpCompArgs (hashref | arrayref)" 4 .IX Item "HttpCompArgs (hashref | arrayref)" Arguments to the \s-1HTTP\s0 fetching component constructor. .IP "MaxHttpComp (integer)" 4 .IX Item "MaxHttpComp (integer)" The number of concurrent http agents (i.e. the number of POE::Component::Client::HTTP sessions) that are allowed. The default is 10, but for anything other than a toy application, something in the order of 50 ~ 100 is the recommended value. .Sp Unless this number is less than 10, the broker starts with 10 sessions, and successively grows the pool of agents when there are not enough agents to handle the currently available jobs, until the maximum is reached. .Sp If the max is less than 10, the starting number if equal to the max. .Sh "initialize" .IX Subsection "initialize" Initializes the broker object. .ie n .Sh "attr(key => $value)" .el .Sh "attr(key => \f(CW$value\fP)" .IX Subsection "attr(key => $value)" General purpose getter/stter for attributes. .Sh "dns_comp_class" .IX Subsection "dns_comp_class" The class name for \s-1DNS\s0 resolver component. .Sh "dns_comp_alias" .IX Subsection "dns_comp_alias" The alias for \s-1DNS\s0 resolver component. .Sh "states" .IX Subsection "states" Returns the states list as passed to the POE::Session constructor. .SH "STATES" .IX Header "STATES" States are all called either by \fIyield()\fR or \fIpost()\fR. The arguments described below are to be used in that context, i.e. yield('state', \f(CW$arg1\fR, \f(CW$arg2\fR...) .Sh "check_job_type" .IX Subsection "check_job_type" .Sh "create_dns_cache" .IX Subsection "create_dns_cache" Creates and sets the \s-1DNS\s0 cache. You probably don't need to worry about this. .Sh "create_http_comp_data" .IX Subsection "create_http_comp_data" .Sh "create_http_request" .IX Subsection "create_http_request" Creates a new HTTP::Request object to be fetched. .Sh "dispatch_http_fetch($job)" .IX Subsection "dispatch_http_fetch($job)" Start an \s-1HTTP\s0 fetch for \f(CW$job\fR. \f(CW$job\fR must have a \s-1HTTP\s0 fetcher associated to it. .Sh "dispatch_to_lightest_load($job)" .IX Subsection "dispatch_to_lightest_load($job)" Choose the \s-1HTTP\s0 fetcher session with the least load, and call dispath_http_fetch after associating it to a job .Sh "fake_error_response" .IX Subsection "fake_error_response" Create a fake \s-1HTTP\s0 error response, which is passed to handle_http_response. This is used to notify internal errors to the handler. .Sh "install_sighandlers" .IX Subsection "install_sighandlers" Installs the global signal handlers. .Sh "spawn_dns_comp" .IX Subsection "spawn_dns_comp" Spawns the component to resolve \s-1DNS\s0 lookups. .Sh "spawn_http_comp($howmany)" .IX Subsection "spawn_http_comp($howmany)" .Sh "signal_http_comp" .IX Subsection "signal_http_comp" Send a signal to the specified \s-1HTTP\s0 component. .Sh "shutdown_broker" .IX Subsection "shutdown_broker" Sets the shutdown flag on the broker. The broker will attempt to shutdown gracefully. .Sh "handle_dns_response" .IX Subsection "handle_dns_response" .Sh "handle_http_response" .IX Subsection "handle_http_response" .Sh "handle_signal" .IX Subsection "handle_signal" Handle a given signal. The signal name is in \s-1ARG0\s0. .Sh "register_dns_request" .IX Subsection "register_dns_request" .Sh "register_http_request" .IX Subsection "register_http_request" .Sh "unregister_http_request" .IX Subsection "unregister_http_request" .Sh "finalize_job" .IX Subsection "finalize_job" .SH "SEE ALSO" .IX Header "SEE ALSO" Xango::Broker::Pull Xango::Broker::Push .SH "AUTHOR" .IX Header "AUTHOR" Copyright (c) 2005 Daisuke Maki . All rights reserved. Development funded by Brazil, Ltd.