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

Better sync API #61

Closed
shashi opened this issue Mar 6, 2018 · 1 comment
Closed

Better sync API #61

shashi opened this issue Mar 6, 2018 · 1 comment

Comments

@shashi
Copy link
Member

shashi commented Mar 6, 2018

right now we do on(identity, observable) to get observable to start sending updates to Julia.

I bet it's easy to make this asynchronous -- one should be able to add the handler after a widget has been displayed -- this would allow InteractNext to not send stuff to Julia by default allowing it to be used entirely client-sided.

@shashi
Copy link
Member Author

shashi commented Mar 7, 2018

Maybe this will work:

  1. All observables in a Scope sync automatically when you call on(f, obs) for the first time. Except:

  2. An observable can be marked as private using either @private scope["name"] = Observable() syntax or `private(scope, "name1", "name2", ...).

Marking as private means that the observable only exists in Julia. You can access it via Scope["name"] -- setting and getting will work on Julia, but not on JS unless the same object is used as a public observable in another scope. What this allows is to tack on "derived observables" to a Scope. (e.g. ob2 here can be exposed at scope["julia_value"] and WebIO will not try to copy it to the client). Private observables may deal with values that cannot be serialized to JSON (such as Julia functions see JuliaGizmos/InteractNext.jl#3).

@shashi shashi closed this as completed in 6a971d9 Mar 7, 2018
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

No branches or pull requests

1 participant