Skip to content

Conversation

@linev
Copy link
Member

@linev linev commented Jul 27, 2017

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.

linev added 14 commits July 26, 2017 19:41
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
@linev linev requested a review from bellenot July 27, 2017 13:27
@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, ubuntu14/native with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@phsft-bot
Copy link

Build failed on ubuntu14/native.
See console output.

Failing tests:

@bellenot bellenot merged commit 84ec875 into root-project:master Jul 27, 2017
@linev linev deleted the sync_methods branch July 27, 2017 15:02
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

Successfully merging this pull request may close these issues.

3 participants