-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Make body!() and content!() synchronous. #136
Conversation
A couple questions:
|
After this, I think the only remaining major API that doesn't have a synchronous option is opening a Window. It's annoying that that isn't synchronous as well, so i'd like to tackle that too, but it'll have to be a different PR. :) |
Removed 5 `sleep(1)` statements, and reduced test time by 4.5 seconds: ``` $ time julia test/content/api.jl # Before julia test/content/api.jl 15.07s user 0.33s system 28% cpu 54.958 total $ time julia test/content/api.jl # After julia test/content/api.jl 15.60s user 0.35s system 31% cpu 51.197 total ```
Friendly ping. This passes all tests. Is there any objection to me just merging this in? :] |
LGTM. |
Cool, thanks a bunch! :) |
Thanks for the PR! :) |
:) No problem! Also, i've just realized it's worth noting that I left That said, I think probably I think probably the best way to proceed is after also checking-in #137, we have a single PR that flips the defaults. I think probably that should happen with a version bump, though, since it changes behavior. Does that sound right to you? :) |
Adds an option,
async
tobody!()
andcontent!()
, which whentrue
willgive the old behavior (return immediately), but when false, will block until
the
Window
is finishedeval
ing the javascript statement to assign the new content.Note that this blocks until
evalscripts
has been called for all new scripts,but that if your scripts themselves do anything asynchronous, it won't wait for
them to finish.
Right now, I have
async=true
by default so that this doesn't change thecurrent behavior, but I really think we should set this false by default! :) If
you want, we can merge it in like this, wait for it to soak in, make sure
everyone likes the change, etc, and then flip the switch?
That said, it shouldn't break anyone's code to just flip the default, it will
just likely make it a bit slower.
Part of fixing #108.