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

Multisession support #34

Merged
merged 12 commits into from
Aug 6, 2024
Merged

Multisession support #34

merged 12 commits into from
Aug 6, 2024

Conversation

aqasemi
Copy link
Contributor

@aqasemi aqasemi commented Jul 29, 2024

Hey.

Please review this pr and tell me what do you think. I managed to make it run seamlessly with multiple devices/sessions at the same time and in one process.

No breaking changes were introduced. One can either use the regular way to create clients (with NewClient) exactly as before this PR, or with the client factory ClientFactory and it will manage clients and events by itself.

@aqasemi
Copy link
Contributor Author

aqasemi commented Jul 29, 2024

#33

@krypton-byte
Copy link
Owner

LGTM, I appreciate your pull request and you did a great job. I will merge your pull request as soon as possible.

Regarding this part:

@staticmethod
def get_all_devices(db: str) -> List["Device"]:

Could the database data be retrieved from self.database_name?

Like this:

def get_all_devices(self) -> List["Device"]:
    c_string = gocode.GetAllDevices(self.database_name).decode() 
    ...

Or, if it's better, could we rename the method to:

@staticmethod
def get_all_devices_from_db(db: str) -> List["Device"]:
    c_string = gocode.GetAllDevices(db).decode()

Then, the implementation using self.database_name would be:

def get_all_devices(self) -> List["Device"]:
    return self.get_all_devices_from_db(self.database_name)

@aqasemi
Copy link
Contributor Author

aqasemi commented Jul 31, 2024

done.
thanks for the feedback.
I preferred the latter to easily read from multiple db files.

@krypton-byte krypton-byte merged commit 97667a0 into krypton-byte:master Aug 6, 2024
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