예제 #1
0
파일: context.py 프로젝트: wuyongwen/doge
 def get_lb(self, eps: List[EndPoint]) -> Union[RoundrobinLB, RandomLB]:
     name = self.url.get_param("loadBalance", "RoundrobinLB")
     if name == "RandomLB":
         return RandomLB(self.url, eps)
     elif name == "RoundrobinLB":
         return RoundrobinLB(self.url, eps)
     raise ReferCfgError
예제 #2
0
def lb():
    url = URL("127.0.0.1", 4399, "")
    ep = EndPoint(url)
    return RandomLB(url, [ep])
예제 #3
0
 def get_lb(self, eps):
     name = self.url.get_param("loadBalance", "RoundrobinLB")
     if name == "RandomLB":
         return RandomLB(self.url, eps)
     elif name == "RoundrobinLB":
         return RoundrobinLB(self.url, eps)
예제 #4
0
 def get_lb(self, eps):
     name = self.url.get_param('loadbalance', 'RoundrobinLB')
     if name == "RandomLB":
         return RandomLB(self.url, eps)
     elif name == "RoundrobinLB":
         return RoundrobinLB(self.url, eps)