Skip to content
Snippets Groups Projects
Commit 241fc7f0 authored by Danilo Piparo's avatar Danilo Piparo
Browse files

[JupyROOT] Improve code logic and adapt test

parent c58b7b9c
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,7 @@ class Poller(Thread):
self.ro_ref().is_running = False
else:
self.poll = False
self.ro_ref().is_running = False
return
class Runner(object):
......@@ -107,7 +108,7 @@ class Runner(object):
>>> r.AsyncRun("Asynchronous");print("Synchronous");time.sleep(1)
Synchronous
Asynchronous
>>> r.AsyncRun("Asynchronous"); print(r.HasFinished())
>>> r.AsyncRun("Asynchronous"); time.sleep(.2); print(r.HasFinished())
False
>>> time.sleep(1)
Asynchronous
......@@ -131,20 +132,16 @@ class Runner(object):
return self.function(argument)
def AsyncRun(self, argument):
self.is_running = True
self.argument_queue.put(argument)
def Wait(self):
while self.is_running: pass
def HasFinished(self):
if self.is_running: return False
return True
return False if self.is_running else True
def Stop(self):
self.Wait()
self.argument_queue.put(None)
self.Wait()
class JupyROOTDeclarer(Runner):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment