05 Jun 2017 14:11:33 UTC
- Distribution: POE-Component-MessageQueue
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Testers (422 / 46 / 0)
- KwaliteeBus factor: 1
- 66.78% Coverage
- License: perl_5
- Activity24 month
- Download (75.43KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:IRONCAMEL Naveed Massjouniand 3 contributors
- David Snopek (http://www.hackyourlife.org)
- Paul Driver
- Daisuke Maki
- Reverse dependencies
- CPAN Testers List
- Dependency graph
POE::Component::MessageQueue::Storage -- Parent of provided storage engines
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.
- 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.
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.
- 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.
- remove optional-aref
Removes the message(s) specified by the passed id(s).
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).
Starts shutting down the storage engine. The storage engine will attempt to do any cleanup (persisting of messages, etc) before calling the callback.
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
Module Install Instructions
To install POE::Component::MessageQueue, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install POE::Component::MessageQueue
For more information on module installation, please visit the detailed CPAN module installation guide.