18 : limit_(limit), overflown_(false), outstanding_updates_() {
24 std::lock_guard<std::mutex> lock(mutex_);
25 return (pushInternal(op_type, lease));
27 return (pushInternal(op_type, lease));
33 std::lock_guard<std::mutex> lock(mutex_);
34 return (popInternal(op_type));
36 return (popInternal(op_type));
42 std::lock_guard<std::mutex> lock(mutex_);
51 std::lock_guard<std::mutex> lock(mutex_);
52 outstanding_updates_.clear();
55 outstanding_updates_.clear();
62 std::lock_guard<std::mutex> lock(mutex_);
63 return (outstanding_updates_.size());
65 return (outstanding_updates_.size());
70 if (outstanding_updates_.size() >= limit_) {
74 outstanding_updates_.push_back(std::make_pair(op_type, lease));
80 if (outstanding_updates_.empty()) {
83 auto item = outstanding_updates_.front();
84 outstanding_updates_.pop_front();
dhcp::LeasePtr pop(OpType &op_type)
Returns the next lease update and removes it from the queue.
size_t size()
Returns the current size of the queue.
bool push(const OpType op_type, const dhcp::LeasePtr &lease)
Appends lease update to the queue.
void clear()
Removes all lease updates from the queue.
bool wasOverflown()
Checks if the queue was overflown.
OpType
Type of the lease update (operation type).
LeaseUpdateBacklog(const size_t limit)
Constructor.
static MultiThreadingMgr & instance()
Returns a single instance of Multi Threading Manager.
boost::shared_ptr< Lease > LeasePtr
Pointer to the lease object.
Defines the logger used by the top-level component of kea-lfc.