Skip to content

IGNITE-13967 Optimize and refactor of parsing response from server.#10

Closed
ivandasch wants to merge 8 commits intoapache:masterfrom
ivandasch:ignite-13967
Closed

IGNITE-13967 Optimize and refactor of parsing response from server.#10
ivandasch wants to merge 8 commits intoapache:masterfrom
ivandasch:ignite-13967

Conversation

@ivandasch
Copy link
Copy Markdown
Contributor

No description provided.

@ivandasch ivandasch force-pushed the ignite-13967 branch 2 times, most recently from 3cbc0cc to 0888fa8 Compare February 3, 2021 15:11
Copy link
Copy Markdown
Contributor

@isapego isapego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. See my minor comments and suggestions.


def __init__(
self, client: 'Client', prefetch: bytes = b'', timeout: int = None,
self, client: 'Client', timeout: float = 2.0,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why timeout is float? Is it a common practice for python?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this is seconds and fraction of seconds. i.e. timeout for 150 ms is 0.15

with self._mux:
if self._in_use:
raise ConnectionError('Connection is in use.')
self._in_use = True
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the point of this flag? I don't really get it.

Comment thread pyignite/stream/binary_stream.py Outdated
self.conn = args[0]
elif len(args) == 2:
buf = args[0]
self.conn = args[1]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we make a conn argument to always be a first one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, looks like a good idea

Comment on lines +49 to +56
@property
def compact_footer(self) -> bool:
return self.conn.client.compact_footer

@compact_footer.setter
def compact_footer(self, value: bool):
self.conn.client.compact_footer = value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we only need a conn here for binary configuration parameters. Maybe it makes sense to make a separate class for that? Like, BinaryContext, BinaryMetaProvider or something like that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original author use this property as auto-discovery of compact-footer for server.
I suppose that create separate class for 1 param seems like overengineering here.

@asfgit asfgit closed this in 2ead7b9 Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants