This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import heapq | |
| from dataclasses import dataclass | |
| class LoadBalancer: | |
| def __init__(self, hosts) -> None: | |
| if not hosts: | |
| # throw an error because there are no hosts at all | |
| raise ValueError | |
| self.hosts = hosts |