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

Method dispatchToTransform

Libraries/AsyncStreams/AsyncStreams.cpp:1317–1336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1315}
1316
1317void AsyncPipeline::dispatchToTransform(AsyncBufferView::ID bufferID, size_t transformIndex)
1318{
1319 SC_ASYNC_STREAMS_ASSERT_RELEASE(transformIndex < MaxTransforms);
1320 AsyncReadableStream* readable = transformInputs[transformIndex];
1321 AsyncDuplexStream* transform = transforms[transformIndex];
1322 SC_ASYNC_STREAMS_ASSERT_RELEASE(readable != nullptr);
1323 SC_ASYNC_STREAMS_ASSERT_RELEASE(transform != nullptr);
1324
1325 if (hasPendingWritesForReadable(*readable))
1326 {
1327 readable->pause();
1328 const Result res = readable->unshift(bufferID);
1329 if (not res)
1330 {
1331 eventError.emit(res);
1332 }
1333 return;
1334 }
1335 asyncWriteWritable(bufferID, *readable, *transform);
1336}
1337
1338Result AsyncPipeline::chainTransforms(AsyncReadableStream*& readable)
1339{

Callers 1

listenToEventDataMethod · 0.80

Calls 2

pauseMethod · 0.80
unshiftMethod · 0.45

Tested by

no test coverage detected