Skip to content
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

Full refactoring and async usage (Release 0.4.0) #55

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

FalseR20
Copy link
Contributor

@FalseR20 FalseR20 commented Aug 10, 2023

Full refactoring of structure

[0.4.0]

Added

  • Async usage (AScConnection and AScClient)
  • Opportunity to mock testing

Changed

  • Object Oriented Programming style
  • Connection handlers
  • Exceptions
  • Models small features
    • Moved ScType to models directory
    • Made value field for ScAddr and ScType as property and cannot be changed in runtime
    • Add __lt__ method for the ability to sort ScAddrs
  • Constants
  • Tests
  • Logging
  • Typing

Removed

  • Storing of used sc-server responses
  • Deprecated usage of a list in ScTemplate triplets (now tuple and operator >>)
  • Deprecated methods of ScTemplateResult:
    • results.size(), use len(results)
    • results.get(...), use results[...]
    • results.for_each_triple(...), use for src, edge, trd in results ...
  • ScAgent, ScModule and ScKeynodes (now in kpm)

@FalseR20 FalseR20 added the refactor Do better label Aug 10, 2023
@FalseR20 FalseR20 self-assigned this Aug 10, 2023
@FalseR20 FalseR20 changed the title Full refactoring Full refactoring + async Aug 18, 2023
@FalseR20 FalseR20 marked this pull request as ready for review August 28, 2023 10:01
src/sc_client/core/async_sc_connection.py Outdated Show resolved Hide resolved
src/sc_client/core/async_sc_connection.py Outdated Show resolved Hide resolved
src/sc_client/core/async_sc_connection.py Outdated Show resolved Hide resolved
src/sc_client/core/async_sc_connection.py Outdated Show resolved Hide resolved
src/sc_client/core/async_sc_connection.py Outdated Show resolved Hide resolved
src/sc_client/core/async_sc_connection.py Outdated Show resolved Hide resolved
src/sc_client/core/sc_client_.py Outdated Show resolved Hide resolved
src/sc_client/core/async_sc_client_.py Outdated Show resolved Hide resolved
src/sc_client/core/async_sc_client_.py Outdated Show resolved Hide resolved
src/sc_client/core/sc_client_.py Show resolved Hide resolved

async def _send_with_reconnect(self, data: str) -> None:
retries: int = self.reconnect_retries
while True:
Copy link
Member

Choose a reason for hiding this comment

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

Can we use another condition for this cycle instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed on for statement

from sc_client.testing.response_callback import ResponseCallback


class WebsocketStub:
Copy link
Member

Choose a reason for hiding this comment

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

Can you add tests to check performance of sc-client?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

idk

@NikitaZotov
Copy link
Member

NikitaZotov commented Sep 21, 2023

Can I check your changes in sc-web?

@FalseR20
Copy link
Contributor Author

FalseR20 commented Sep 22, 2023

Can I check your changes in sc-web?

Yeah. Also passed the integrated py-sc-kpm tests, so you can rest assured that everything works as before

@FalseR20 FalseR20 changed the title Full refactoring + async Full refactoring and async usage (Release 0.4.0) Sep 22, 2023
@FalseR20 FalseR20 removed their assignment Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Do better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants