| 427 | } |
| 428 | |
| 429 | void AsyncReadableStream::reactivate(bool doReactivate) |
| 430 | { |
| 431 | switch (state) |
| 432 | { |
| 433 | case State::SyncPushing: { |
| 434 | if (doReactivate) |
| 435 | { |
| 436 | state = State::SyncReadMore; |
| 437 | } |
| 438 | else |
| 439 | { |
| 440 | state = State::CanRead; |
| 441 | } |
| 442 | } |
| 443 | break; |
| 444 | case State::AsyncPushing: { |
| 445 | if (doReactivate) |
| 446 | { |
| 447 | executeRead(); // -> State::Reading |
| 448 | } |
| 449 | else |
| 450 | { |
| 451 | state = State::CanRead; |
| 452 | } |
| 453 | } |
| 454 | break; |
| 455 | default: { |
| 456 | emitError(Result::Error("AsyncReadableStream::reactivate - called in wrong state")); |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | void AsyncReadableStream::pause() |
| 462 | { |