MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / afterWrite

Method afterWrite

Libraries/AsyncStreams/AsyncStreams.cpp:1433–1467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1431}
1432
1433void AsyncPipeline::afterWrite(AsyncBufferView::ID bufferID)
1434{
1435 // Decrement reference count of the buffer that was just written
1436 source->getBuffersPool().unrefBuffer(bufferID);
1437
1438 const bool drainedPendingWrites = retryPendingWrites();
1439 if (not drainedPendingWrites)
1440 {
1441 return;
1442 }
1443
1444 if (shouldEndWhenDrained)
1445 {
1446 if (source != nullptr and source->hasQueuedData())
1447 {
1448 source->resumeReading();
1449 return;
1450 }
1451 shouldEndWhenDrained = false;
1452 endPipes();
1453 return;
1454 }
1455
1456 // Try resume in reverse
1457 for (size_t idx = 0; idx < MaxTransforms; ++idx)
1458 {
1459 AsyncDuplexStream* transform = transforms[MaxTransforms - 1 - idx];
1460 if (transform)
1461 {
1462 transform->resumeWriting();
1463 transform->resumeReading();
1464 }
1465 }
1466 source->resumeReading();
1467}
1468
1469void AsyncPipeline::dispatchToPipes(AsyncBufferView::ID bufferID)
1470{

Callers

nothing calls this directly

Calls 3

unrefBufferMethod · 0.80
resumeReadingMethod · 0.80
resumeWritingMethod · 0.80

Tested by

no test coverage detected