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

Method afterFinalize

Libraries/AsyncStreams/AsyncStreams.cpp:986–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

984 }
985}
986
987void AsyncTransformStream::afterFinalize(Span<char> outputAfter, bool streamEnded)
988{
989 const size_t consumedOutput = outputData.sizeInBytes() - outputAfter.sizeInBytes();
990 if (consumedOutput > 0)
991 {
992 // Ignore whatever push returns because later on the stream is either finalizing or pausing either way
993 (void)AsyncReadableStream::push(outputBufferID, consumedOutput);
994 }
995 AsyncReadableStream::getBuffersPool().unrefBuffer(outputBufferID);
996 if (streamEnded)
997 {
998 AsyncReadableStream::pushEnd();
999 state = State::Finalized; // --> Transition to ENDED (all data written)
1000 }
1001 else
1002 {
1003 state = State::Paused;
1004 tryFinalize();
1005 }
1006}
1007
1008void AsyncTransformStream::tryFinalize()

Callers

nothing calls this directly

Calls 2

unrefBufferMethod · 0.80
sizeInBytesMethod · 0.45

Tested by

no test coverage detected