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
Make kernel connection function synchronous #4725
Conversation
Rebased on master... |
@blink1073 - do you remember why the kernel connectTo function returns a promise, i.e., is asynchronous? jupyterlab/packages/services/src/kernel/default.ts Lines 1312 to 1324 in 98d0671
Just checking to make sure I'm not messing things up by not remembering why it is the way it is. |
Tracing it back further, https://github.com/jupyterlab/jupyterlab/blame/09884af82886c630d0f2fa662d6f8a1525613100/packages/services/src/kernel/default.ts#L1343 indicates that we used to get the kernel model from the server if we didn't have it available locally. This was changed in the rework of services for 1.0, specifically in https://github.com/jupyterlab/jupyterlab/pull/3294/files#diff-6ce6e61bad53706cd4a7885e25ecc551R1324 It seems that now the arguments include the model, and that is all we need to create a DefaultKernel. So it does seem that the finalization of the services library was where we basically decided that connectTo did not need to be asynchronous (i.e., didn't need to query the server). |
That sounds right to me. I'd say leave it, not worth the major version bump. |
Thanks. We're already doing a major version bump (to make the kernel message processing async and in order), so I was seeing if it was possible to fix this while we're at it. @ian-r-rose - I think we may be able to get this into beta 3....I'll spend just a little bit more time chasing down the loose ends. |
I think this may actually be good to go for beta 3. |
@ian-r-rose - could you review 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.
I took a read-through, LGTM!
Thanks Steve! |
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 saw one problem here that was not your fault, otherwise, looks good to me!
// Create the header of the about dialog | ||
let headerLogo = (<img src={kernelIconUrl} />); | ||
let title = ( | ||
<span className='jp-About-header'>, |
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 happened when converting the dialogs to JSX, but I saw it when testing: this JSX has commas in it that it should not 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.
I went ahead and fixed the issue, hope you don't mind @jasongrout
Looks good, thanks @jasongrout! |
Related to work in and built on top of #4697.