本文整理汇总了C++中ice::ObjectPrxPtr::begin_ice_flushBatchRequests方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrxPtr::begin_ice_flushBatchRequests方法的具体用法?C++ ObjectPrxPtr::begin_ice_flushBatchRequests怎么用?C++ ObjectPrxPtr::begin_ice_flushBatchRequests使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectPrxPtr
的用法示例。
在下文中一共展示了ObjectPrxPtr::begin_ice_flushBatchRequests方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: request
void
BatchRequestQueue::finishBatchRequest(OutputStream* os, const Ice::ObjectPrxPtr& proxy, const std::string& operation)
{
//
// No need for synchronization, no other threads are supposed
// to modify the queue since we set _batchStreamInUse to true.
//
assert(_batchStreamInUse);
_batchStream.swap(*os);
try
{
_batchStreamCanFlush = true; // Allow flush to proceed even if the stream is marked in use.
if(_maxSize > 0 && _batchStream.b.size() >= _maxSize)
{
#ifdef ICE_CPP11_MAPPING
proxy->ice_flushBatchRequests_async();
#else
proxy->begin_ice_flushBatchRequests();
#endif
}
assert(_batchMarker < _batchStream.b.size());
if(_interceptor)
{
BatchRequestI request(*this, proxy, operation, static_cast<int>(_batchStream.b.size() - _batchMarker));
#ifdef ICE_CPP11_MAPPING
_interceptor(request, _batchRequestNum, static_cast<int>(_batchMarker));
#else
_interceptor->enqueue(request, _batchRequestNum, static_cast<int>(_batchMarker));
#endif
}
else
{
_batchMarker = _batchStream.b.size();
++_batchRequestNum;
}
Lock sync(*this);
_batchStream.resize(_batchMarker);
_batchStreamInUse = false;
_batchStreamCanFlush = false;
notifyAll();
}
catch(const std::exception&)
{
Lock sync(*this);
_batchStream.resize(_batchMarker);
_batchStreamInUse = false;
_batchStreamCanFlush = false;
notifyAll();
throw;
}
}