The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

DESCRIPTION

The role implemented by all storage engines. It provides a few bits of global functionality, but mostly exists to define the interface for storage engines.

CONCEPTS

optional arefs

Some functions take an "optional aref" as an argument. What this means is that you can pass either a plain-old-scalar argument (such as a message id) or an arrayref of such objects. If you pass the former, your callback (if any) will receive a single value. If the latter, it will receive an arrayref. Note that the normalization is done by this role - storage engines need only implement the version that takes an aref, and send arefs to the callbacks.

callbacks

Every storage method has a callback as its last argument. Callbacks are Plain Old Subs. If the method doesn't have some kind of return value, the callback is optional and has no arguments. It's simply called so you you know the method is done. If the method does have some kind of return value, the callback is not optional and the argument will be said value. Return values of storage functions are not significant and should never be used. Unless otherwise specified, assume the functions below have plain success callbacks.

INTERFACE

set_logger SCALAR

Takes an object of type POE::Component::MessageQueue::Logger that should be used for logging. This isn't a storage method and does not have any callback associated with it.

store Message

Takes one or more objects of type POE::Component::MessageQueue::Message that should be stored.

get optional-aref

Passes the message(s) specified by the passed id(s) to the callback.

get_all
get_oldest

Self-explanatory.

remove optional-aref

Removes the message(s) specified by the passed id(s).

empty

Deletes all messages from the storage engine.

claim optional-aref, client-id

Naively claims the specified messages for the specified client, even if they are already claimed. This is intended to be called by stores that wrap other stores to maintain synchronicity between multiple message copies - non-store clients usually want claim_and_retrieve.

claim_and_retrieve destination, client-id

Claims the "next" message intended for destination for client-id and passes it to the supplied callback. Storage engines are free to define what "next" means, but the intended meaning is "oldest unclaimed message for this destination".

disown_all client-id

Disowns all messages owned by the client.

disown_destination destination, client-id

Disowns the message owned by the specified client on the specified destination. (This should only be one message).

storage_shutdown

Starts shutting down the storage engine. The storage engine will attempt to do any cleanup (persisting of messages, etc) before calling the callback.

SEE ALSO

POE::Component::MessageQueue, POE::Component::MessageQueue::Storage::BigMemory, 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::Double, POE::Component::MessageQueue::Storage::Throttled, POE::Component::MessageQueue::Storage::Complex, POE::Component::MessageQueue::Storage::Default