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

Multiple enhancements #9

Merged
merged 11 commits into from
May 14, 2024
Merged

Multiple enhancements #9

merged 11 commits into from
May 14, 2024

Conversation

fcollonval
Copy link
Member

@Wh1isper
Copy link

Thanks for the mention.

For stdin issue, it seems that the problem is the timing of the stdin input?

In my understanding, with the help of the front-end, the user should be able to input stdin via front-end. Without a front-end or any interaction page (which can be something like a terminal), it might be hard to support this feature.

@fcollonval
Copy link
Member Author

For stdin issue, it seems that the problem is the timing of the stdin input?

Not sure to understand. But the main problem is that we have no idea ahead of execution if a snippet will prompt for stdin. So the execution request caller should interrogate the server or be notified when such event occurs.
For now, the solution is to poll a end point to determine the status of the execution - in process, finished or waiting for an input.

Without a front-end or any interaction page (which can be something like a terminal), it might be hard to support this feature.

With the above mentioned mechanism, any case is supported. Although how to prompt for user input is gonna changed depending on the front end.

@Wh1isper
Copy link

But the main problem is that we have no idea ahead of execution if a snippet will prompt for stdin.

Yes, that's what I meant. Actually it was this PR that reminded me of it. (Probably because I've basically never used inputs in Jupyter..)

For now, the solution is to poll a end point to determine the status of the execution - in process, finished or waiting for an input.

And it depends on when the client (front-end) sends, which means that the front-end still needs to listen to the websocket and display the input prompt box. 🤔

@fcollonval fcollonval marked this pull request as ready for review May 14, 2024 12:49
@fcollonval fcollonval self-assigned this May 14, 2024
@fcollonval fcollonval requested a review from echarles May 14, 2024 12:51
Copy link
Member

@echarles echarles left a comment

Choose a reason for hiding this comment

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

LGTM Thx @fcollonval

@echarles echarles merged commit bd3b38c into main May 14, 2024
10 checks passed
@fcollonval fcollonval deleted the enh/multiple branch May 14, 2024 13:02
@fcollonval
Copy link
Member Author

And it depends on when the client (front-end) sends, which means that the front-end still needs to listen to the websocket and display the input prompt box. 🤔

@Wh1isper It requires fetching a status endpoint. See that sequence diagram: https://github.com/datalayer/jupyter-server-nbmodel?tab=readme-ov-file#with-input-case

You can see an updated demo there

@Wh1isper
Copy link

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should code be executed asynchronously in RTC mode?
3 participants