pull in additional changes from 2.0 branch.
[monitor.git] / monitor / Rpyc / Demo / testmodule.py
diff --git a/monitor/Rpyc/Demo/testmodule.py b/monitor/Rpyc/Demo/testmodule.py
new file mode 100644 (file)
index 0000000..20d2bc9
--- /dev/null
@@ -0,0 +1,19 @@
+import time\r
+from Rpyc.Factories import Async\r
+\r
+def threadfunc(callback):\r
+    """this function will call the callback every second"""\r
+    callback = Async(callback)\r
+    try:\r
+        while True:\r
+            callback()\r
+            time.sleep(1)\r
+    except:\r
+        print "thread exiting"\r
+\r
+def printer(text):\r
+    print text\r
+\r
+def caller(func, *args):\r
+    func(*args)\r
+    
\ No newline at end of file