Catalyst-Engine-XMPP2
view release on metacpan or search on metacpan
lib/Catalyst/Engine/XMPP2.pm view on Meta::CPAN
chain operations in a more complex choreography. In order to do that,
you just need to send new messages while processing other messages, in
order to do that, you can access the engine object by using $c->engine
and use one of the following methods
=over
=item $c->engine->send_message($c, $to, $type, $create_cb, %attrs)
This will call send_message on the connection that generated the
current request with the parameters as described in
AnyEvent::XMPP::Connection.
One important hint: if $create_db is a CODE ref, it will be executed
with a XML::Writer object in UNSAFE mode as its first argument, which
means you can call "raw" on it to send unencoded data.
As you'll be sending the message with the connection that generated
this request, it will have the complete JID, with the resource, as the
"from".
=item $c->engine->send_presence($c, $type, $create_cb, %attrs)
Same as above.
=item $c->engine->send_iq($c, $type, $create_cb, $result_cb, %attrs)
Same as above.
Hint: $result_cb is a coderef that will be executed once the response
for this iq arrives. This method won't block, so you might have to
implement a semaphore if the reply for this iq is relevant to the rest
of this request.
=back
=head1 DIRECT CONNECTION MANIPULATION
This is strongly discouraged, but it might be life-saving for some
corner cases.
=over
=item $c->engine->connection($c)
Access the connection object that generated the current request.
=item $c->engine->connections()
This returns a hashref identifying all the connections by the resource
name.
=back
=head1 INTERNAL METHODS
=over
=item $engine->handle_xmpp_node($app, $resource, $node)
This method is called by the stanza callbacks in the connections.
=back
=head1 SEE ALSO
L<Catalyst::Engine>, L<Catalyst::Engine::CGI>, L<HTTP::Request>,
L<HTTP::Reponse>, L<Catalyst>, L<AnyEvent::XMPP::Connection>,
L<Catalyst::Engine::Embeddable>
=head1 AUTHORS
Daniel Ruoso C<daniel@ruoso.com>
=head1 BUG REPORTS
Please submit all bugs regarding C<Catalyst::Engine::XMPP2> to
C<bug-catalyst-engine-xmpp2@rt.cpan.org>
=head1 LICENSE
This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
( run in 0.809 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )