| 1189 | |
| 1190 | struct State { |
| 1191 | State(AsyncGenerator<AsyncGenerator<T>> source, int max_subscriptions) |
| 1192 | : source(std::move(source)), |
| 1193 | active_subscriptions(max_subscriptions), |
| 1194 | delivered_jobs(), |
| 1195 | waiting_jobs(), |
| 1196 | mutex(), |
| 1197 | first(true), |
| 1198 | broken(false), |
| 1199 | source_exhausted(false), |
| 1200 | outstanding_requests(0), |
| 1201 | num_running_subscriptions(0), |
| 1202 | final_error(Status::OK()) {} |
| 1203 | |
| 1204 | Future<AsyncGenerator<T>> PullSource() { |
| 1205 | // Need to guard access to source() so we don't pull sync-reentrantly which |