Hi,

I am writing some extensions which I need. The extensions have different 
purposes, but I'd like to ensure, that one of them has run before the other 
ones are run.

What is a good way to do this? (no busy wait if not necessary)

In each of the extensions I am listening for the notebook to be loaded like 
this:


/////////// BEGIN
function load_ipython_extension() {
            if (Jupyter.notebook !== undefined && 
Jupyter.notebook._fully_loaded) {
                if (!initialized) {
                    init();
                }
            } else {
                if (!initialized) {
                    events.on('notebook_loaded.Notebook', () => {
                        init();
                    });
                }
            }
        }
/////////// END

Then in init happens the actual work.
This was a practice suggested in some issue on Github and I already adopted 
that, but how can I be sure that extension A runs before extensions B, C 
and D, regardless of the specifics of what they do? Is there some event I 
could listen to, which contains the name of the extension? Maybe something 
like:

/////////// BEGIN
events.on('extension_loaded.ExtensionName')
/////////// END

Or a simple way to introduce such an event myself, without changing the 
notebook source code itself, maybe some generic event sending, where I can 
put in any name I want for the event and then listen for that in the other 
extensions?

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/926c0539-e9a1-43d2-aad7-b3128df2936d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to