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

Callers 1

listenToEventDataMethod · 0.80

Calls 2

pauseMethod · 0.80
unshiftMethod · 0.45

Tested by

no test coverage detected