-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix some formatting and typos #17
Conversation
Hi @jsdanielh ! |
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.
Looks great- few comments inline; most not critical, only the float->int change requires further discussion
retry_config (dict): Tenacity.retry config (@see https://tenacity.readthedocs.io/en/latest/api.html#retry-main-api) | ||
default_response_timeout (float): default time in seconds | ||
retry_config (dict): Tenacity.retry config (@see https://tenacity.readthedocs.io/en/latest/api.html#retry-main-api) | ||
default_response_timeout (int): default time in seconds |
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.
default_response_timeout
ends up being propagated to asyncio.wait_for - which does accept float ;
So float seems the more correct option, allowing the caller to actually set fractions of a second for the timeout
simple_websocket = self._serializing_socket_cls(WebSocketSimplifier(websocket, frame_type=self._frame_type)) | ||
channel = RpcChannel(self.methods, simple_websocket, sync_channel_id=self._rpc_channel_get_remote_id, **kwargs) | ||
logger.info(f"Client connected", { | ||
'remote_address': websocket.client}) |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
@@ -84,11 +87,13 @@ async def main_loop(self, websocket: WebSocket, client_id: str = None, **kwargs) | |||
data = await simple_websocket.recv() | |||
await channel.on_message(data) | |||
except WebSocketDisconnect: | |||
logger.info(f"Client disconnected - {websocket.client.port} :: {channel.id}") | |||
logger.info( | |||
f"Client disconnected - {websocket.client.port} :: {channel.id}") |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
await self.handle_disconnect(websocket, channel) | ||
except: | ||
# cover cases like - RuntimeError('Cannot call "send" once a close message has been sent.') | ||
logger.info(f"Client connection failed - {websocket.client.port} :: {channel.id}") | ||
logger.info( | ||
f"Client connection failed - {websocket.client.port} :: {channel.id}") |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
@@ -2,7 +2,8 @@ | |||
import sys | |||
|
|||
# Add parent path to use local src as package for tests | |||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) | |||
sys.path.append(os.path.abspath(os.path.join( | |||
os.path.dirname(__file__), os.path.pardir))) |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
@@ -3,7 +3,8 @@ | |||
import sys | |||
|
|||
# Add parent path to use local src as package for tests | |||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) | |||
sys.path.append(os.path.abspath(os.path.join( | |||
os.path.dirname(__file__), os.path.pardir))) |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
@@ -3,7 +3,8 @@ | |||
import sys | |||
|
|||
# Add parent path to use local src as package for tests | |||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) | |||
sys.path.append(os.path.abspath(os.path.join( |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
@@ -13,7 +13,8 @@ | |||
import sys | |||
|
|||
# Add parent path to use local src as package for tests | |||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) | |||
sys.path.append(os.path.abspath(os.path.join( |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
@@ -5,7 +5,8 @@ | |||
from websockets.exceptions import InvalidStatusCode | |||
|
|||
# Add parent path to use local src as package for tests | |||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) | |||
sys.path.append(os.path.abspath(os.path.join( |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
@@ -6,7 +6,8 @@ | |||
import sys | |||
|
|||
# Add parent path to use local src as package for tests | |||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) | |||
sys.path.append(os.path.abspath(os.path.join( |
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.
This seems inconsistent with the other changes here (preferring to have code in a single line)
- Fix some formatting and typos in several files. - Rename `RpcUtilityMethods`'s `get_proccess_details` method to `get_process_details`.
@orweis I applied your suggestion on the type change for the timeout. I actually went and changed it in some other places that were specifying |
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.
Awesomeness. :)
Thank you @jsdanielh
RpcUtilityMethods
'sget_proccess_details
method toget_process_details
.