##// END OF EJS Templates
Add stdout flushing statements to example....
Fernando Perez -
Show More
@@ -3,6 +3,8 b''
3
3
4 from IPython.kernel import client
4 from IPython.kernel import client
5 import time
5 import time
6 import sys
7 flush = sys.stdout.flush
6
8
7 tc = client.TaskClient()
9 tc = client.TaskClient()
8 mec = client.MultiEngineClient()
10 mec = client.MultiEngineClient()
@@ -16,6 +18,7 b' for i in range(6):'
16 time.sleep(1.0)
18 time.sleep(1.0)
17 print "Queue status (vebose=False)"
19 print "Queue status (vebose=False)"
18 print tc.queue_status()
20 print tc.queue_status()
21 flush()
19
22
20 for i in range(24):
23 for i in range(24):
21 tc.run(client.StringTask('time.sleep(1)'))
24 tc.run(client.StringTask('time.sleep(1)'))
@@ -24,12 +27,14 b' for i in range(6):'
24 time.sleep(1.0)
27 time.sleep(1.0)
25 print "Queue status (vebose=True)"
28 print "Queue status (vebose=True)"
26 print tc.queue_status(True)
29 print tc.queue_status(True)
30 flush()
27
31
28 for i in range(12):
32 for i in range(12):
29 tc.run(client.StringTask('time.sleep(2)'))
33 tc.run(client.StringTask('time.sleep(2)'))
30
34
31 print "Queue status (vebose=True)"
35 print "Queue status (vebose=True)"
32 print tc.queue_status(True)
36 print tc.queue_status(True)
37 flush()
33
38
34 qs = tc.queue_status(True)
39 qs = tc.queue_status(True)
35 sched = qs['scheduled']
40 sched = qs['scheduled']
@@ -41,4 +46,5 b' for i in range(6):'
41 time.sleep(1.0)
46 time.sleep(1.0)
42 print "Queue status (vebose=True)"
47 print "Queue status (vebose=True)"
43 print tc.queue_status(True)
48 print tc.queue_status(True)
49 flush()
44
50
General Comments 0
You need to be logged in to leave comments. Login now