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

Method CreateConcurrencyLimiter

src/brpc/server.cpp:755–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755bool Server::CreateConcurrencyLimiter(const AdaptiveMaxConcurrency& amc,
756 ConcurrencyLimiter** out) {
757 if (amc.type() == AdaptiveMaxConcurrency::UNLIMITED) {
758 *out = NULL;
759 return true;
760 }
761 const ConcurrencyLimiter* cl =
762 ConcurrencyLimiterExtension()->Find(amc.type().c_str());
763 if (cl == NULL) {
764 LOG(ERROR) << "Fail to find ConcurrencyLimiter by `" << amc.value() << "'";
765 return false;
766 }
767 ConcurrencyLimiter* cl_copy = cl->New(amc);
768 if (cl_copy == NULL) {
769 LOG(ERROR) << "Fail to new ConcurrencyLimiter";
770 return false;
771 }
772 *out = cl_copy;
773 return true;
774}
775
776
777static AdaptiveMaxConcurrency g_default_max_concurrency_of_method(0);

Callers

nothing calls this directly

Calls 6

typeMethod · 0.45
FindMethod · 0.45
c_strMethod · 0.45
valueMethod · 0.45
NewMethod · 0.45

Tested by

no test coverage detected