git://git.onelab.eu
/
monitor.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge branch 'master' of ssh://git.planet-lab.org/git/monitor
[monitor.git]
/
monitor
/
Rpyc
/
Demo
/
testmodule.py
1
import time
\r
2
from Rpyc.Factories import Async
\r
3
\r
4
def threadfunc(callback):
\r
5
"""this function will call the callback every second"""
\r
6
callback = Async(callback)
\r
7
try:
\r
8
while True:
\r
9
callback()
\r
10
time.sleep(1)
\r
11
except:
\r
12
print "thread exiting"
\r
13
\r
14
def printer(text):
\r
15
print text
\r
16
\r
17
def caller(func, *args):
\r
18
func(*args)
\r
19