com::pcbsys::nirvana::client::nQueueAsyncReader Class Reference

This Reader enables the client to receive all events asynchronously. More...

#include <nQueueAsyncReader.h>

Inheritance diagram for com::pcbsys::nirvana::client::nQueueAsyncReader:
com::pcbsys::nirvana::client::nQueueReader com::pcbsys::nirvana::client::nQueueAsyncTransactionReader

Public Member Functions

virtual void close ()
 Close the subscription, and notify the server.
 
virtual void closeLocally ()
 Close the subscription, but don't notify the server.
 
bool isPaused ()
 Returns true if the subscription of the reader is currently paused. More...
 
void pauseReader ()
 Pause the subscription of the nQueueAsyncReader. More...
 
void resumeReader ()
 Resumes the subscription of the nQueueAsyncReader. More...
 
- Public Member Functions inherited from com::pcbsys::nirvana::client::nQueueReader
void destroyReader ()
 This call will release any outstanding resources on the server and close the reader. More...
 
void destroyReaderLocally ()
 This call will close local reader resources but remain subscribed at the server Any future calls to this object will work unless destroyReader() is called. More...
 
bool hasConsumedEvents ()
 Method to see whether the reader has consumed any events. More...
 
bool isClosed ()
 When a reader is closed, the physical subscription is closed at the server. More...
 
bool isClosedLocally ()
 A reader can be closed, but the physical subscription queue is not closed at the server. More...
 
nConsumeEvent ** peek (nQueuePeekContext *pContext, int &nEvent)
 Performs a non destructive read. More...
 

Static Protected Attributes

static const longlong ASYNC_READER_UNIQUE_ID = -1
 Unique identifier for asynchronous readers. Use a constant value for all asynchronous readers, since there will be at most one such reader in a session and the server will need to distinguish that from any synchronous readers in the same session. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from com::pcbsys::nirvana::client::nQueueReader
static nQueuePeekContextcreateContext (int windowSize=0, const std::string &selector="")
 Creates a Queue Peek Context, which is used to traverse the queue. More...
 
- Protected Member Functions inherited from com::pcbsys::nirvana::client::nQueueReader
 nQueueReader (nQueue *pQueue, nQueueReaderContext *pContext)
 Creates a reader for the specified queue using the given reader context. The reader will have its reader unique ID assigned implicitly. More...
 
 nQueueReader (nQueue *pQueue, nQueueReaderContext *pContext, longlong readerUniqueId)
 Creates a reader for the specified queue using the given reader context and reader unique identifier. Note: This constructor must only be used for asynchronous readers, which require special reader ID assignment, for all other cases use the constructor which implicitly assigns the reader unique identifier. More...
 
- Protected Attributes inherited from com::pcbsys::nirvana::client::nQueueReader
longlong m_readerUniqueId
 An identifier that uniquely identifies the reader which performs this queue operation within the session. This will be paired with the connection id to uniquely identify the reader within the Universal Messaging server. Note: This should be considered final, it must be set during reader creation and not modified afterwards. More...
 

Detailed Description

This Reader enables the client to receive all events asynchronously.

The callback method was passed as part of the nQueueReaderContext. This class provides no pop methods, since it is all asynchronous delivery.

Member Function Documentation

bool com::pcbsys::nirvana::client::nQueueAsyncReader::isPaused ( )

Returns true if the subscription of the reader is currently paused.

False otherwise.

void com::pcbsys::nirvana::client::nQueueAsyncReader::pauseReader ( )

Pause the subscription of the nQueueAsyncReader.

This means that no new events will be received from the server until the subscription is resumed. All events that have already been received will be processed normally.

Exceptions
nSessionPausedExceptionThe session is currently paused, please resume
nSessionNotConnectedExceptionThe session is not currently connected to the server
nRequestTimedOutExceptionif the request exceeded the timeout value
nUnexpectedResponseExceptionReceived a response from the server which we can not deal with, see the message for further information
void com::pcbsys::nirvana::client::nQueueAsyncReader::resumeReader ( )

Resumes the subscription of the nQueueAsyncReader.

See Also
nQueueAsyncReader#pauseReader()
Parameters
pReaderthe nQueueAsyncReader registered as a subscriber
Exceptions
nSessionPausedExceptionThe session is currently paused, please resume
nSessionNotConnectedExceptionThe session is not currently connected to the server
nRequestTimedOutExceptionif the request exceeded the timeout value
nUnexpectedResponseExceptionReceived a response from the server which we can not deal with, see the message for further information

Field Documentation

const longlong com::pcbsys::nirvana::client::nQueueAsyncReader::ASYNC_READER_UNIQUE_ID = -1
staticprotected

Unique identifier for asynchronous readers. Use a constant value for all asynchronous readers, since there will be at most one such reader in a session and the server will need to distinguish that from any synchronous readers in the same session.