-
Notifications
You must be signed in to change notification settings - Fork 26
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
Callback implementation for Python GCL API #31
base: main
Are you sure you want to change the base?
Conversation
sample update
sample update
|
||
|
||
def create_session(self, service_name, context, callback): | ||
|
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.
docstring will be useful here
|
||
return new_session | ||
|
||
def close(self, wait_for_sessions_completion=True): |
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.
Either I would rename close
to delete_session
or rename create_session
to open
return new_session | ||
|
||
def close(self, wait_for_sessions_completion=True): | ||
print("Connector: Closing HTC-Grid Connector") |
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.
please use logging library instead of
|
||
return new_session | ||
|
||
def close(self, wait_for_sessions_completion=True): |
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.
docstring will be useful here
self.wait_for_sessions_completion = wait_for_sessions_completion | ||
|
||
def register_session(self, new_session): | ||
assert(new_session.session_id not in self.active_sessions) |
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.
docstring will be useful here
self.active_sessions[new_session.session_id] = new_session | ||
pass | ||
|
||
def diregister_session(self, session): |
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.
Is there a typo in the in the method name (diregister)?
|
||
|
||
def check_tasks_states(self): | ||
print(f"Session: Checking status {self.session_id}, submitted: {len(self.submitted_task_ids)}, received: {len(self.received_task_ids)}") |
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.
Can you logging library instead of print please.
|
||
|
||
def check_tasks_states(self): | ||
print(f"Session: Checking status {self.session_id}, submitted: {len(self.submitted_task_ids)}, received: {len(self.received_task_ids)}") |
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.
Docstring will be useful here
Description
This is a draft for the Python Grid Connector Library with support of (client-based) callbacks.
This is not a final version but a draft for the code review.
What is implemented:
What is not implemented
Checklist
README.md
, or thedocs
directory)area/controlplane
) and kind (e.g.kind/improvement
)BONUS POINTS checklist: