Tapir::MethodCall - A method call
The MethodCall object represents all the context and data necessary for a single method call within the API. It's generated by a Tapir::Server (most likely the Tapir::Server::ThriftAMQP) when a new request is taken off the wire.
This is a generic module, to be used with any Tapir::Server, but for simplicity sake we will act as though you'll be using the ThriftAMQP server, because you likely will be.
The MethodCall is a subclass of POE::Component::Sequence, and will contain all the logic necessary to handle a request in it's action and callback sequences.
Call with a list of key/value pairs to setup a new method sequence. See "Accessors" for which keys are standard.
The IDL definition of the service.
The IDL definition of the method.
The parsed message arguments.
The parsed message.
Meta data from the transport layer; includes header information and raw frames. See "subscribe" in POE::Component::Client::AMQP::Queue. Hash like:
The logger inherited from Tapir::Server
The return value of "is_valid_request" in Tapir::Server.
The Tapir::Server object.
Calls dereference_fieldset on the message arguments. If the first argument is bool true, the 'plain' will be set to true. If the second argument is bool true, the 'insecure' flag will be set to true.
my $hash = dereference_fieldset($parser_fieldset, { plain => 0, insecure => 0 });
Internal, recursive algorithm that will descend into the fieldset given and return a perl hash representing the structure. The keys of the hash will be the 'name' method of the Thrift::Parser::Field. The value of the hash will be either the 'value' or 'value_plain' method of the Thrift::Parser::Field, depending on the passed value of 'plain'. If the value is another fieldset, this subroutine will call itself on that value for the stored value.
If 'insecure' is true, any fields which have a '@secure' flag in the documentation will have their values replaced with a placeholder string.
Returns an arrayref of AMQP headers. You probably want header() (below).
my $status_queue = $self->header('Request-Status-Queue');
Returns the value of a header. Case insensitive.
These methods all store the scalar value passed as the method reply value and finish the sequence. It's expected that the calling code will return after calling one of these finishing methods:
return $method_call->set_result(145);
The result can be either a fully typed Thrift::Parser::Type object or a untyped Perl scalar which will be cast into the expected value.
See Thrift::Parser::Message::compose_reply.
See Thrift::Parser::Message::compose_reply_application_exception; throws an 'UNKNOWN' application error with the text of this error message.
Takes an IDL-defined exception (as a hash ref or blessed reference, see Thrift::Parser::Message::compose_reply_exception) or TApplicationException.
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =heac2
To install Tapir, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tapir
CPAN shell
perl -MCPAN -e shell install Tapir
For more information on module installation, please visit the detailed CPAN module installation guide.