Hello! Some ideas about how to sync + wait for calculations to finish before drawing

Hello everyone,

My name is Evan Bolyen and I would really love to work with you all on
Bokeh.

I am still reading through your coffeescript so I apologize if I have
misunderstood anything, please feel free to correct me.

I was talking to Bryan at SciPy and he mentioned how different frames(?)
will occasionally fail because they are drawn before Kiwi is finished.
I have explored this particular situation before and a good solution I
have found is to explicitly coordinate reactive variables. This has a
couple of advantages over using JavaScript Events. A reactive variable
can be implemented as an observer pattern over a single variable. Then,
different components can choose to listen to this while providing a
continuation. This provides loose coupling and complete control over
when an action will be preformed without resorting to some kind of
global state or synchronization scheme over an event bus.

For example:

Suppose each frame provided a reactive property called "ready". A single
coordinator will register itself to each frame's "ready"
property/channel, where the continuation it provides will modify the
coordinator's internal state. When all (or enough) frames are ready, the
coordinator can produce an action over the frames to begin rendering.
This can be extended throughout the architecture to potentially produce
a "cascade" of state transitions that can be controlled and reasoned about.

What are your thoughts on this strategy?
Thanks,
-Evan

Hi Evan,

I wanted to thank you for the very useful and informative discussions around BokehJS at the SciPy sprints. I am definitely going to look into this idea for providing the explicit render path synchronization that we need (hoping to try it out this week). I think this is exactly what is needed to solve the problems we were seeing. Can you remind me of the link to the implementation of reactive properties? I want to port them to coffee.

Definitely looking forward to your contributions in the future as well!

Thanks,

Bryan

ยทยทยท

On Jul 11, 2014, at 5:32 PM, Evan Bolyen <[email protected]> wrote:

Hello everyone,

My name is Evan Bolyen and I would really love to work with you all on
Bokeh.

I am still reading through your coffeescript so I apologize if I have
misunderstood anything, please feel free to correct me.

I was talking to Bryan at SciPy and he mentioned how different frames(?)
will occasionally fail because they are drawn before Kiwi is finished.
I have explored this particular situation before and a good solution I
have found is to explicitly coordinate reactive variables. This has a
couple of advantages over using JavaScript Events. A reactive variable
can be implemented as an observer pattern over a single variable. Then,
different components can choose to listen to this while providing a
continuation. This provides loose coupling and complete control over
when an action will be preformed without resorting to some kind of
global state or synchronization scheme over an event bus.

For example:

Suppose each frame provided a reactive property called "ready". A single
coordinator will register itself to each frame's "ready"
property/channel, where the continuation it provides will modify the
coordinator's internal state. When all (or enough) frames are ready, the
coordinator can produce an action over the frames to begin rendering.
This can be extended throughout the architecture to potentially produce
a "cascade" of state transitions that can be controlled and reasoned about.

What are your thoughts on this strategy?
Thanks,
-Evan

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" 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/a/continuum.io/d/msgid/bokeh/53C057ED.6060302%40gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.