NAME

POEx::ProxySession::MessageSender - ProxySession utility Role for sending message

VERSION

version 1.102760

DESCRIPTION

POEx::ProxySession::MessageSender is a utility role that both Client and Server consume to provide common semantics to sending messages.

PROTECTED_ATTRIBUTES

pending

pending stores context related data of messages where a result is expected.

Access this attribute via the following methods:

    handles    => 
    {
        get_pending        => 'get',
        set_pending        => 'set',
        delete_pending     => 'delete',
        count_pending      => 'count',
        has_pending        => 'exists',
        all_pending        => 'values',
    }

queue

queue holds all of the queues for the various connected wheels. If a message is unable to be immediately delivered to a wheel, it will go into that wheel's queue.

Each queue is merely an arrayref of messages to be delivered.

PROTECTED_METHODS

next_message_id

    returns (Int)

This method returns the next message id to be used.

send_result

    (Bool :$success, ProxyMessage :$original, Ref :$payload?, WheelID :$wheel_id) is Event

This is a convenience method for sending result messages to the original sender.

send_message

    (Str :$type, Ref :$payload, WheelID :$wheel_id) is Event

This method creates a message with the provided payload and delivers it via the connection that wheel_id references.

return_to_sender

    (ProxyMessage :$message,WheelID :$wheel_id, SessionID :$return_session,Str :$return_event,Ref :$tag?) is Event

This method sends a message, and also stores context information related to the message including where to send the result.

AUTHOR

Nicholas Perez <nperez@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Nicholas Perez.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.