Facilitates read/write operations on messages The mailbox can be used in either a pull or push mode, i.e. clients of the mailbox may register an event_listener which will push new messages as they are received. Alternatively clients may choose to poll the mailbox for new messages.
If the mailbox has pending messages this return false
Returns true if mailbox is still in service
Returns the first unread message in the mailbox Will throw an exception if (empty() == true)
Posts a message via the mailbox May throw an exception if (active() == false)
Registers an event_listener with the mailbox The mailbox will trigger the on_event message of the listener each time a new message is received with an event_type of "message". If the mailbox is closed gracefully the listener will also be informed with a "closed" event message. A mailbox will support no more than one event_listener per client. If calling listener->on_event(...) fails the mailbox will assume the client is no longer available and the mailbox will close.
Unregisters an EventListener