NAME

POE::Component::MessageQueue::Storage -- Parent of provided storage engines

DESCRIPTION

The parent class of the provided storage engines. This is an "abstract" class that can't be used as is, but defines the interface for other objects of this type.

INTERFACE

set_message_stored_handler CODEREF

Takes a CODEREF which will get called back when a message has been successfully stored. This functwion will be called with one argument, the name of the destination.

set_dispatch_message_handler CODEREF

Takes a CODEREF which will get called back when a message has been retrieved from the store. This will be called with three arguments: the message, the destination string, and the client id. If no message could be retrieved the function will still be called but with the message undefined.

set_destination_ready_header CODEREF

Takes a CODEREF which will get called back when a destination is ready to be claimed from again. This is necessary for storage engines that will lock a destination while attempting to retrieve a message. This handler will be called when the destination is unlocked so that message queue knows that it can claim more messages. If your storage engine doesn't lock anything, you must call this handler immediately after called the above handler.

It will be called with a single argument: the destination string.

set_logger SCALAR

Takes an object of type POE::Component::MessageQueue::Logger that should be used for logging.

get_next_message_id

Should return the next available message_id.

store SCALAR

Takes an object of type POE::Component::MessageQueue::Message that should be stored. This call will eventually result in the message_stored_handler being called exactly once.

remove SCALAR

Takes a message_id to be removed from the storage engine.

claim_and_retrieve SCALAR, SCALAR or HASHREF

Takes the destination string and client id (or a HASHREF with keys "destination" and "client_id"). Should claim a message for the given client id on the given destination. This call will eventually result in the dispatch_message_handler and destination_ready_handler being called exactly once each.

disown SCALAR, SCALAR

Takes a destination and client id. All messages which are owned by this client id on this destination should be marked as owned by nobody.

SEE ALSO

POE::Component::MessageQueue, POE::Component::MessageQueue::Storage::Memory, POE::Component::MessageQueue::Storage::DBI, POE::Component::MessageQueue::Storage::FileSystem, POE::Component::MessageQueue::Storage::Generic, POE::Component::MessageQueue::Storage::Generic::DBI, POE::Component::MessageQueue::Storage::Throttled, POE::Component::MessageQueue::Storage::Complex