POE::Component::Server::Bayeux::Request - A single Bayeux request


POE-Component-Server-Bayeux documentation  | view source Contained in the POE-Component-Server-Bayeux distribution.

Index


NAME

Top

POE::Component::Server::Bayeux::Request - A single Bayeux request

DESCRIPTION

Top

Objects in this class represent a single Bayeux request made to a Bayeux server. Requests are instantiated with an HTTP::Request and HTTP::Response object. This class is responsible for parsing the request content into a JSON object, creating one or more POE::Component::Server::Bayeux::Message objects that represent the possible message types of the Bayeux protocol, and handling each one in turn.

CLASS METHODS

Top

new ()

Requires 'request' (POE::Component::Server::HTTP::Request), 'response' (POE::Component::Server::HTTP::Response), and 'server_heap'. Returns init()'ed class object.

OBJECT METHODS

Top

handle ()

Call after creating the request. Calls the pre_handle(), handle() methods on each message, possibly completing the request.

complete ()

Completes the request, calling the post_handle() method on the messages that need it.

PRIVATE METHODS

Top

These methods are mainly called by messages during their handle() phase.

client ($id)

Returns a POE::Component::Server::Bayeux::Client object with the given id.

add_response ($response)

Adds a message response onto the stack of responses.

clear_stack ()

Clears all messages and responses.

add_post_handle ($message)

Adds a message to be handled in the post_handle() code.

init ()

Parses the POE::Component::Server::HTTP::Request object, extracting the JSON payload, creating a stack of POE::Component::Server::Bayeux::Message messages.

error ($message)

Convienence method to throw an error, returning to the client.

form_response (@messages)

Encodes the messages into the payload of the response

logger ()

Returns the server's logger.

subscribe ($client_id, $channel)

Passthru to the POE server's subscribe state

unsubscribe ($client_id, $channel)

Passthru to the POE server's unsubscribe state

publish ($client_id, $channel, $data)

Passthru to the POE server's publish state

COPYRIGHT

Top

AUTHOR

Top

Eric Waters <ewaters@uarc.com>


POE-Component-Server-Bayeux documentation  | view source Contained in the POE-Component-Server-Bayeux distribution.