| 1397 | } |
| 1398 | |
| 1399 | bool AsyncPipeline::retryPendingWrites() |
| 1400 | { |
| 1401 | for (PendingWrite& pendingWrite : pendingWrites) |
| 1402 | { |
| 1403 | if (not pendingWrite.bufferID.isValid()) |
| 1404 | continue; |
| 1405 | |
| 1406 | SC_ASYNC_STREAMS_ASSERT_RELEASE(pendingWrite.writable != nullptr); |
| 1407 | if (not pendingWrite.writable->canAcceptWrite()) |
| 1408 | { |
| 1409 | continue; |
| 1410 | } |
| 1411 | |
| 1412 | Function<void(AsyncBufferView::ID)> func; |
| 1413 | func.template bind<AsyncPipeline, &AsyncPipeline::afterWrite>(*this); |
| 1414 | const Result res = pendingWrite.writable->write(pendingWrite.bufferID, func); |
| 1415 | if (res) |
| 1416 | { |
| 1417 | pendingWrite.readable = nullptr; |
| 1418 | pendingWrite.writable = nullptr; |
| 1419 | pendingWrite.bufferID = {}; |
| 1420 | } |
| 1421 | else |
| 1422 | { |
| 1423 | source->getBuffersPool().unrefBuffer(pendingWrite.bufferID); |
| 1424 | pendingWrite.readable = nullptr; |
| 1425 | pendingWrite.writable = nullptr; |
| 1426 | pendingWrite.bufferID = {}; |
| 1427 | eventError.emit(res); |
| 1428 | } |
| 1429 | } |
| 1430 | return not hasPendingWrites(); |
| 1431 | } |
| 1432 | |
| 1433 | void AsyncPipeline::afterWrite(AsyncBufferView::ID bufferID) |
| 1434 | { |
nothing calls this directly
no test coverage detected