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

Clean up the handling of execution #2266

Merged
merged 12 commits into from May 25, 2017

Conversation

@blink1073
Copy link
Member

@blink1073 blink1073 commented May 23, 2017

The output area needs much of the raw information from the kernel messages to render output, clear output, handle response payloads, and stdin messages. This PR modifies the Kernel.IFuture to provide a simpler interface that can be consumed by the output area.

@blink1073
Copy link
Member Author

@blink1073 blink1073 commented May 23, 2017

Note to self: implement #1227 in this PR if possible.

@blink1073 blink1073 mentioned this pull request May 24, 2017
@blink1073 blink1073 changed the title [WIP] Clean up the handling of execution Clean up the handling of execution May 24, 2017
Copy link
Contributor

@ellisonbg ellisonbg left a comment

Other than my slight preference of reordering the arguments to OutputArea.execute this looks really solid. I think this will help the code to scale to more usage cases and keep the concerns separate. Very nice!

* Execute a cell given a client session.
*/
export
function execute(cell: CodeCell, session: IClientSession): Promise<KernelMessage.IExecuteReplyMsg> {
Copy link
Contributor

@ellisonbg ellisonbg May 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this how all turned out!

cell.setPrompt('*');
model.trusted = true;

return OutputArea.execute(cell.outputArea, code, session).then(msg => {
Copy link
Contributor

@ellisonbg ellisonbg May 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a very slight preference to swap the order of the code and outputArea arguments as it more closely matches how I think about the logic = "run this code and send the output to this output area."

* Execute code on an output area.
*/
export
function execute(output: OutputArea, code: string, session: IClientSession): Promise<KernelMessage.IExecuteReplyMsg> {
Copy link
Contributor

@ellisonbg ellisonbg May 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe swap the order of code and output.

@ellisonbg ellisonbg added this to the Beta milestone May 25, 2017
@ellisonbg
Copy link
Contributor

@ellisonbg ellisonbg commented May 25, 2017

Merging!

@ellisonbg ellisonbg merged commit 397ddb4 into jupyterlab:master May 25, 2017
2 checks passed
@blink1073 blink1073 mentioned this pull request May 30, 2017
@blink1073 blink1073 deleted the notebook-execution-refactor branch Jun 6, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants