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

Method resumeReading

Libraries/AsyncStreams/AsyncStreams.cpp:481–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481void AsyncReadableStream::resumeReading()
482{
483 switch (state)
484 {
485 case State::Pausing:
486 case State::Paused: {
487 executeRead(); // -> State::Reading
488 }
489 break;
490 case State::Ended: {
491 if (not readQueue.isEmpty())
492 {
493 emitOnData();
494 }
495 else
496 {
497 maybeDestroyEndedReadable();
498 }
499 }
500 break;
501 case State::CanRead: {
502 executeRead(); // -> State::Reading
503 }
504 break;
505 case State::AsyncReading: {
506 Result res = asyncResumeReading();
507 if (not res)
508 {
509 emitError(res);
510 }
511 }
512 break;
513 case State::Stopped:
514 case State::Errored: {
515 emitError(Result::Error("AsyncReadableStream::resume - called in wrong state"));
516 }
517 break;
518 default: break; // Ignore resume requests while reading
519 }
520}
521
522void AsyncReadableStream::destroy()
523{

Callers 9

onStreamReceiveMethod · 0.80
operator()Method · 0.80
beginResponseReadMethod · 0.80
startBodyStreamMethod · 0.80
startMethod · 0.80
afterWriteMethod · 0.80
endPipesMethod · 0.80

Calls 2

ErrorEnum · 0.50
isEmptyMethod · 0.45

Tested by

no test coverage detected