Daisuke Maki
and 1 contributors

NAME

Gungho::Component::Core - Gungho Core Methods

METHODS

new($config)

This method has been deprecated. Use run() instead.

run

Starts the Gungho process. It requires either the name of a config filename or a hashref.

has_feature($name)

Returns true if Gungho supports some feature $name

setup()

Sets up the Gungho environment, including calling the various setup_* methods to configure the provider, engine, handler, etc.

setup_components()

setup_engine()

setup_handler()

setup_log()

setup_provider()

setup_plugins()

Sets up the various components.

register_hook($hook_name => $coderef[, $hook_name => $coderef])

Is deprecated. Use register_event instead.

register_event($event, $observer)

Registers an observer that gets notified when $event happens. The $observer argument can be either an object implementing notify(), or a subroutine reference.

unregister_event($event, $observer)

Unregisters an observer from the specified event

run_hook($hook_name, @args)

Is deprecated. Use notify() instead.

notify($event, @args)

Notifies observers of an event.

has_requests

Delegates to provider's has_requests

get_requests

Delegates to provider's get_requests

handle_response

Delegates to handler's handle_response

handle_dns_response

Delegates to engine's send_request upon successful DNS response

dispatch_requests

Calls provider->dispatch

prepare_request($req)

Given a request, preps it before sending it to the engine

prepare_response($req)

Given a response, preps it before sending it to handle_response()

send_request

Delegates to engine's send_request

pushback_request

Push back a request

load_config($config)

Loads the config from $config via Config::Any.

load_gungho_module($name, $prefix)

Loads a Gungho component. Compliments the module name with 'Gungho::$prefix::', unless the name is prefixed with a '+'. In that case, no transformation is performed, and the module name is used as-is.

request_is_allowed($req)

Returns true if the given request is allowed to be fetched (this has nothing to do with authentication and such, and is purely internal)

shutdown($reason)

Shuts down Gungho. Call this if you want to tell the entire system to stop. This method in turn calls stop methods on the Engine, Provider, and Handler objects