| 597 | } |
| 598 | |
| 599 | void RunDispatcher(TCont* c) { |
| 600 | TRequestPtr req; |
| 601 | |
| 602 | while (true) { |
| 603 | Reqs.DequeueSafe(c, req); |
| 604 | |
| 605 | if (!req) { |
| 606 | break; |
| 607 | } |
| 608 | |
| 609 | TChannelPtr& ch = Channels.Get(req->RI->Id); |
| 610 | |
| 611 | if (!ch) { |
| 612 | ch.Reset(new TChannel(c->Executor(), req->RI)); |
| 613 | } |
| 614 | |
| 615 | ch->Enqueue(req); |
| 616 | } |
| 617 | |
| 618 | c->Executor()->Abort(); |
| 619 | } |
| 620 | |
| 621 | TThreadRef Thr; |
| 622 | TOneConsumerPipeQueue<TRequest> Reqs; |