P5EEx-Blue-0.01

P5EEx::Blue::Messaging


NAME

P5EEx::Blue::Messaging - Interface for sending/receiving (possibly) async messages


SYNOPSIS

    use P5EEx::Blue::P5EE;
    $context = P5EEx::Blue::P5EE->context();
    $messaging = $context->service("Messaging");  # or ...
    $messaging = $context->messaging();
    ($status, $ticket) = $messaging->send(
        recipient => $recipient,
        message => $message
    );
    $message = $messaging->receive();
    $message = $messaging->receive(
        sender => $sender,
    );
    $message = $messaging->receive(
        ticket => $ticket,
    );


DESCRIPTION

A Messaging service is a means by which data can be sent asynchronously (or synchronously) to a recipient and responses can be received.

Because the possibility exists for the messaging channel to be asynchronous, code that uses a Messaging service must code for the most complicated case (asynchronous).


Class Group: Messaging

The following classes might be a part of the Messaging Class Group.


Class: P5EEx::Blue::Messaging

A Messaging service is a means by which data can be sent synchronously or asynchronously to a recipient and responses can be received.

 * Throws: P5EEx::Blue::Exception::Messaging
 * Since:  0.01

Class Design

...


Constructor Methods:

new()

The constructor is inherited from P5EEx::Blue::Service.


Public Methods:

send()

    * Signature: ($status, $ticket) = $messaging->send(%named);
    * Param:     recipient          string
    * Param:     message            binary
    * Return:    $status            integer
    * Return:    $ticket            string
    * Throws:    P5EEx::Blue::Exception::Messaging
    * Since:     0.01
    Sample Usage:
    ($status, $ticket) = $messaging->send(
        recipient => "stephen.adkins\@officevision.com",
        message => "Hello.",
    );

receive()

    * Signature: $message = $messaging->receive();
    * Signature: $message = $messaging->receive(%named);
    * Param:     sender          string
    * Param:     ticket          string
    * Return:    $message        binary
    * Throws:    P5EEx::Blue::Exception::Messaging
    * Since:     0.01
    Sample Usage:
    # receive next available message
    $message = $messaging->receive();
    # receive next message from sender
    $message = $messaging->receive(
        sender => "stephen.adkins\@officevision.com",
    );
    # receive message associated with ticket
    $message = $messaging->receive(
        ticket => "XP305-3jks37sl.f299d",
    );


Protected Methods:

service_type()

Returns 'Messaging'.

    * Signature: $service_type = P5EEx::Blue::Messaging->service_type();
    * Param:     void
    * Return:    $service_type  string
    * Since:     0.01
    $service_type = $widget->service_type();


ACKNOWLEDGEMENTS

 * Author:  Stephen Adkins <stephen.adkins@officevision.com>
 * License: This is free software. It is licensed under the same terms as Perl itself.


SEE ALSO

P5EEx::Blue::Context, P5EEx::Blue::Service