Closed ashtonmv closed 3 years ago
Instead of actually changing juniper, I basically got what I wanted by modifying the jupyter KernelFutureHandler's _handleDone
function to dispatch an event to the document that I can then listen for.
(t.prototype._handleDone = function () {
// the existing _handleDone function
this._testFlag(o.KernelFutureFlag.IsDone) || (this._setFlag(o.KernelFutureFlag.IsDone), this._done.resolve(this._replyMsg), this._disposeOnDone && this.dispose());
// add and dispatch a new event
var event = new CustomEvent('juniper-executed', { detail: this._replyMsg });
document.dispatchEvent(event);
}),
This doesn't actually remove juniper's "loading" status, but it at least provides a hook by which I can modify the active juniper-cell accordingly. And dispatching this._replyMsg
is nice because it contains a status (event.detail.content.status
) and the cell's execution count on the server (event.detail.content.execution count
).
First of all, thanks @ines for creating an amazing tool.
My only problem is I occasionally want to create cells that don't return anything to stdout, and then Juniper's status remains a misleading "loading" even though the cell has finished executing. For example,
If I understand correctly, it's because the MyBinder server doesn't send any of the specific messages that Juniper is looking for in the first cell, e.g. a stdout message or failure to trigger
outputArea.model.clear()
and insert something other thanmsgLoading
.So I'm trying to figure out how to listen for a more generic "finished" event sent back by the mybinder server - basically, whatever background event triggers the Jupyter cell input-prompt to change from
In [*]
toIn [1]
on MyBinder itself. I will keep trying to figure it out, but maybe someone else has more of a clue than I do.