File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -23,31 +23,26 @@ def do():
2323 print 'watch finished...'
2424
2525def task1 ():
26- def asyncSet ():
26+
27+ for i in range (10 ):
28+ print 'now set...'
2729 setVal = random .randint (0 ,99 )
2830 print 'real set - %s' % setVal
2931 client .set ('/nodes/abc' , setVal )
3032 print 'set ok - %s' % setVal
31-
32- for i in range (5 ):
33- print 'now set...'
34- Greenlet .spawn (asyncSet ).join ()
3533 print ('Finished!!!!!!!' )
3634
3735def task2 ():
3836 def asyncGet ():
3937 val = client .read ('/nodes/abc' )
4038 print 'get ok - %s' % val
4139
42- for i in range (5 ):
40+ for i in range (10 ):
4341 print 'now get....'
44- Greenlet .spawn (asyncGet ).join ()
42+ gevent .spawn (asyncGet ).join ()
4543 print ('Finished!!!!!!! Task2' )
4644
4745
48-
49- gevent .sleep (1 )
50-
5146gevent .joinall ([
5247 gevent .spawn (watchTask ),
5348 gevent .spawn (task1 ),
You can’t perform that action at this time.
0 commit comments