File: async_lock.py

package info (click to toggle)
kaa-base 0.6.0%2Bsvn4596-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 2,348 kB
  • ctags: 3,068
  • sloc: python: 11,094; ansic: 1,862; makefile: 74
file content (16 lines) | stat: -rw-r--r-- 261 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import kaa

@kaa.coroutine(policy=kaa.POLICY_SYNCHRONIZED)
def f(x):
    print 'in', x
    yield kaa.NotFinished
    print 'work1', x
    yield kaa.NotFinished
    print 'work2', x
    yield kaa.NotFinished
    print 'out', x
    
f(1)
f(2)
f(3)
kaa.main.run()