-
Notifications
You must be signed in to change notification settings - Fork 35
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
Feature/SK-1071 | Initial refactor of client #722
Conversation
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.
I want @ahellander to look at this also
# Enum for respresenting the result of connecting to the FEDn API | ||
class ConnectToApiResult(enum.Enum): | ||
Assigned = 0 | ||
ComputePackgeMissing = 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.
Spelling error . ComputePackge-Z ComputePackage
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.
Will fix this.
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 like a good refactor, I added two minor comments, but I'm sure this will be iterated on a number of times before replacing v1.
else: | ||
raise ValueError(f"Unsupported event type: {event_type}") | ||
|
||
def notify_subscribers(self, event_type: str, *args, **kwargs): |
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.
I don't understand, what subscribers might a client have?
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.
@ahellander if you look in the client_v2.py file you can see how it is used. The overall idea is that client_api exposes functionality that a client can then make use of... In this particular example the client subscribes to events raised from the client_api. Events include training, validation or inference.
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.
I will add a little example too.
fedn client start-v2 command added
OBS this PR does not replace the current client, it's and initial step to a new client (refactor)
Mainly tried to clean up the existing client. The existing client is left as is. The idea is to let this new solution exist in parallel until it can be the main solution. The functionality of the client is divided into three main classes, GrpcHandler, ClientApi and the "new" Client class. The Client class implements the ClientApi. The Client class can be understood as an example of how to set up your own client.