Storage Engine API
mongo::CappedInsertNotifier Class Reference

Queries with the awaitData option use this notifier object to wait for more data to be inserted into the capped collection. More...

#include <collection.h>

Detailed Description

Queries with the awaitData option use this notifier object to wait for more data to be inserted into the capped collection.

Public Member Functions

 CappedInsertNotifier ()
 
void notifyAll ()
 Wakes up all threads waiting. More...
 
void waitUntil (uint64_t prevVersion, Date_t deadline) const
 Waits until 'deadline', or until notifyAll() is called to indicate that new data is available in the capped collection. More...
 
uint64_t getVersion () const
 Returns the version for use as an additional wake condition when used above. More...
 
void kill ()
 Cancels the notifier if the collection is dropped/invalidated, and wakes all waiting. More...
 
bool isDead ()
 Returns true if no new insert notification will occur. More...
 

Private Attributes

stdx::condition_variable _notifier
 
stdx::mutex _mutex
 
uint64_t _version
 
bool _dead
 

Constructor & Destructor Documentation

◆ CappedInsertNotifier()

mongo::CappedInsertNotifier::CappedInsertNotifier ( )

Member Function Documentation

◆ getVersion()

uint64_t mongo::CappedInsertNotifier::getVersion ( ) const
inline

Returns the version for use as an additional wake condition when used above.

◆ isDead()

bool mongo::CappedInsertNotifier::isDead ( )

Returns true if no new insert notification will occur.

◆ kill()

void mongo::CappedInsertNotifier::kill ( )

Cancels the notifier if the collection is dropped/invalidated, and wakes all waiting.

◆ notifyAll()

void mongo::CappedInsertNotifier::notifyAll ( )

Wakes up all threads waiting.

◆ waitUntil()

void mongo::CappedInsertNotifier::waitUntil ( uint64_t  prevVersion,
Date_t  deadline 
) const

Waits until 'deadline', or until notifyAll() is called to indicate that new data is available in the capped collection.

NOTE: Waiting threads can be signaled by calling kill or notify* methods.

Member Data Documentation

◆ _dead

bool mongo::CappedInsertNotifier::_dead
private

◆ _mutex

stdx::mutex mongo::CappedInsertNotifier::_mutex
mutableprivate

◆ _notifier

stdx::condition_variable mongo::CappedInsertNotifier::_notifier
mutableprivate

◆ _version

uint64_t mongo::CappedInsertNotifier::_version
private

The documentation for this class was generated from the following files: