| 803 | } |
| 804 | |
| 805 | void redis_client_pipeline::stop_channels() const |
| 806 | { |
| 807 | const token_node* iter = channels_->first_node(); |
| 808 | std::vector<redis_pipeline_channel*> channels; |
| 809 | while (iter) { |
| 810 | redis_pipeline_channel* channel = |
| 811 | static_cast<redis_pipeline_channel*>(iter->get_ctx()); |
| 812 | // Notify and wait for the channel thread to exit |
| 813 | channel->stop_thread(); |
| 814 | channels.push_back(channel); |
| 815 | iter = channels_->next_node(); |
| 816 | } |
| 817 | |
| 818 | // Delete all channels threads |
| 819 | for (std::vector<redis_pipeline_channel*>::iterator |
| 820 | it = channels.begin(); it != channels.end(); ++it) { |
| 821 | channels_->remove((*it)->get_addr()); |
| 822 | delete *it; |
| 823 | } |
| 824 | |
| 825 | logger("All channels in pipeline have been stopped!"); |
| 826 | } |
| 827 | |
| 828 | void redis_client_pipeline::start_channels() |
| 829 | { |
nothing calls this directly
no test coverage detected