Example #1
0
void SendWorker::add(const slice::LogDataSeq& data)
{
    ::IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_dataMutex);
     if(_data.size() == 2000)
     {
        std::cout << " cache data count : 2000 over memory limit! " << std::endl;
     }

    _data.insert(_data.end(), data.begin(), data.end());
    _dataMutex.notify();
}
Example #2
0
bool AsyncClient::doSend(const slice::LogDataSeq& data)
{
    ::IceUtil::Monitor<IceUtil::Mutex>::Lock lock(_dataMutex);
    if (_data.size() >= _maxQueueSize)
    {
        XLOG_ERROR("Client::append queue is full, maxQueueSize is " << _maxQueueSize);
        return false;
    }

    _data.insert(_data.end(), data.begin(), data.end());

    _dataMutex.notify();

    return true;
}