Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
ENH: add Client.apply method, adjust TaskStatus to properly capture exceptions #53
ENH: add Client.apply method, adjust TaskStatus to properly capture exceptions #53
Changes from 7 commits
c7a6f1e
f87efc7
8d7d64f
82266c8
dd4cef8
c1ed5e2
1b9d36f
f7c1ad6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Given the extra wrapping of list/not list here, I have to wonder if it would have been simpler for
put
to always return a list of statuses, even if we only put one PVThere 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 had this thought too. In the end I decided that if I, as a user of the
Client
, put to a single PV and had to index into a single-element list, I'd be annoyed.But maybe the users and I can just deal with it 🤷
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 way is probably ok, your explanation here makes sense to me
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
status
guaranteed to be complete afterself.cl.put
returns it?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.
It does currently, since we
asyncio.run
and block until the coroutine is finished. I'm not entirely convinced this is the best way to do things, but returning the status immediately would require us eitherI've been ok with this for now since we have the ability to run parallel puts (and wait on all of them), but it has been something I've been pondering changing
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 think this is totally ok, I wanted to make sure you hadn't skip a
wait
call here (sincewait
was added in this PR).It's not so strange to require more nuanced asynchronous behavior to be done in an async context.
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.
Small documentation thing: you've added this
wait
function here and not documented its inclusion in the release notes or in the PR text. It's also not used anywhere outside the test suite yet.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 thought I'd need it, then I realized the full ramifications of the statuses I'd created 😆