MCPcopy Create free account
hub / github.com/apache/brpc / sub_channel_controller

Method sub_channel_controller

src/brpc/parallel_channel.cpp:418–429  ·  view source on GitHub ↗

Different from sub_done(), sub_channel_controller returns NULL for invalid accesses and never crashes.

Source from the content-addressed store, hash-verified

416 // Different from sub_done(), sub_channel_controller returns NULL for
417 // invalid accesses and never crashes.
418 const Controller* sub_channel_controller(int i) const {
419 if (i >= 0 && i < _nchan) {
420 if (_nchan == _ndone) {
421 return &sub_done(i)->cntl;
422 }
423 const int offset = sub_done_map(i);
424 if (offset >= 0) {
425 return &sub_done(offset)->cntl;
426 }
427 }
428 return NULL;
429 }
430
431private:
432 int _fail_limit;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected