-
Notifications
You must be signed in to change notification settings - Fork 82
refactor nebula client and nebula pool & add async interface & add tests #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| def __post_init__(self): | ||
| """Initialize auth_options with password if provided""" | ||
| if self.password: | ||
| self.auth_options["password"] = self.password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about use provides the password and auth info in the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password和auth_options可以同时配置,对于password则以password中的配置值为准。
| for addr in addresses.split(","): | ||
| addr = addr.strip() | ||
| if ":" in addr: | ||
| host, port = addr.rsplit(":", 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we use ipaddress to support ipv6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前pr没有处理ipv6,有单独的支持ipv6的issue在
| with self._lock: | ||
| # Try to find an available client | ||
| for client in self._pool: | ||
| if not self._in_use.get(client, False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self._in_use.get(client):
continue
| # Try to find an available client | ||
| for client in self._pool: | ||
| if not self._in_use.get(client, False): | ||
| if self.config.test_on_borrow: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.config.test_on_borrow and self._factory.validate(client):
| return | ||
|
|
||
| with self._lock: | ||
| if client in self._in_use: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if client not in self._in_use, should close it and then remove from pool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if client not in use, means the client already be returned to pool, cannot remove and close it.
close #404 #403
基于5.0 sdk的设计 重构python sdk: