-
Notifications
You must be signed in to change notification settings - Fork 7
Add server side outputs handling #30
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
Conversation
knaresh
left a comment
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.
Comments can addressed in followup. I am ok to push this asis
| _cell_ids = Dict(default_value={}) # a map from msg_id -> cell_id | ||
| _cell_indices = Dict(default_value={}) # a map from cell_id -> cell index in notebook | ||
| _file_id = Unicode(default_value=None, allow_none=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.
are entries ever deleted?
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.
Yes the clear method of this class is called in certain cases. Also, the entire instance goes away when the kernel is shutdown.
This PR adds server side outputs handling. There are two different server components in this PR that work together to process outputs on the server:
OutputProcessor. This class intercepts incoming and outgoing kernel messages and tracks which messages are related to which cells (by cell_id). When output messages are sent from the kernel back to the frontend, this class instead transforms the outputs messages into nbformat outputs and saves them to the server side ydoc.OutputsManager. Optionally, the output processor can push outputs to the outputs manager. This class saves the outputs to disk and exposes and rest API. When this is done, the actual output saved to the server ydoc is empty but points to the URL of the output in the output service.