MCPcopy Create free account
hub / github.com/Icinga/icinga2 / FlushIfSafe

Method FlushIfSafe

lib/base/json.cpp:317–322  ·  view source on GitHub ↗

* Flushes the underlying writer if it supports that operation and is safe to do so. * * Safe flushing means that it only performs the flush operation if the @c JsonEncoder has not acquired * any object lock so far. This is to ensure that the stream can safely perform asynchronous operations * without risking undefined behaviour due to coroutines being suspended while the stream is being flushe

Source from the content-addressed store, hash-verified

315 * @param yc The yield context to use for asynchronous operations.
316 */
317void JsonEncoder::Flusher::FlushIfSafe(boost::asio::yield_context* yc) const
318{
319 if (yc && m_AsyncWriter) {
320 m_AsyncWriter->MayFlush(*yc);
321 }
322}
323
324class JsonSax : public nlohmann::json_sax<nlohmann::json>
325{

Callers 3

EncodeArrayMethod · 0.80
EncodeValueGeneratorMethod · 0.80
EncodeObjectMethod · 0.80

Calls 1

MayFlushMethod · 0.80

Tested by

no test coverage detected