-
Notifications
You must be signed in to change notification settings - Fork 1.4k
webgui: implement sync and async methods with optional callbacks #818
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Each call to TCanvas::Modified() increments modify counter. This counter used in then next TCanvas::Update() call to identify current version of canvas. TCanvas::IsModified() will return true until drawing is completed and painter confirms that last version of canvas delivered to all clients and displayed.
By default, TCanvas::Update() will block until latest canvas version delivered to all clients and displayed. Implement with straight polling loop.
By defauly, ROOT will try to crate local window with CEF or Qt5.
If not available, default browser will be started.
If place is specified, it should be program name like:
canvas->Show("/usr/bin/opera");
canvas->Show("firefox");
One could show canvas in several different places.
It let configure more complex program arguments for starting browser for the canvas, provide brief docu
One can call Canvas::SaveAs() several times, all specified files will be created one by one asynchronously
When synchronous mode specified (defualt), method blocked until file is produced. With asynchronous mode method returned and file will be produced in background.
Callback function called when file is created (or command fails)
Invoked when current canvas version delivered to all clients.
When close message send by client, server clear all callbacks and does not reply on the message. Still X is crashing if close called from window.onunload handler
Improve closing of CEF messaging queue
|
Starting build on |
|
Build failed on ubuntu14/native. Failing tests: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now Canvas::Update() and Canvas::SaveAs() can be synchronous and asynchronous.
Sync mean method will block calling thread until completed.
Async returns immediately and let continue script execution.
In both methods one can provide callback functions which invoked once method is completed.
Makes only sense in async mode.
Canvas::Modified() increments version counter, which used to control version delivered to each JS client.
Canvas::IsModified() return false only if all clients have actual version of the canvas
Canvas::Show() now can be provided with "where" parameter, which identifies how canvas should be shown. Parameter can be browser program name or some predefined values: "cef", "qt5", "browser"
First steps are done to correctly cleanup connection to closed/crashed clients.
Probably, watchdog timer should be installed.