MCPcopy Create free account
hub / github.com/alibaba/euler / GetFactory

Method GetFactory

euler/service/server_interface.cc:67–80  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

65
66/* static */
67Status ServerFactory::GetFactory(const ServerDef& server_def,
68 ServerFactory** out_factory) {
69 MutexLock l(get_server_factory_lock());
70 for (const auto& server_factory : *server_factories()) {
71 if (server_factory.second->AcceptsOptions(server_def)) {
72 *out_factory = server_factory.second;
73 return Status::OK();
74 }
75 }
76
77 return Status::NotFound(
78 "No server factory registered for the given ServerDef: ",
79 server_def.DebugString());
80}
81
82// Creates a server based on the given `server_def`, and stores it in
83// `*out_server`. Returns OK on success, otherwise returns an error.

Callers

nothing calls this directly

Calls 4

get_server_factory_lockFunction · 0.85
server_factoriesFunction · 0.85
AcceptsOptionsMethod · 0.80
DebugStringMethod · 0.45

Tested by

no test coverage detected