cleaning up tests

This commit is contained in:
Robert Nishihara
2016-03-08 16:14:02 -08:00
parent 901e890d31
commit 70e62313f0
4 changed files with 92 additions and 69 deletions
+11 -1
View File
@@ -1,3 +1,5 @@
import sys
import orchpy.unison as unison
import orchpy.services as services
import orchpy.worker as worker
@@ -11,8 +13,16 @@ def print_string(string):
def handle_int(a, b):
return a+1, b+1
def address(host, port):
return host + ":" + str(port)
if __name__ == '__main__':
worker.global_worker.connect("127.0.0.1:22221", "127.0.0.1:40000", "127.0.0.1:22222")
ip_address = sys.argv[1]
scheduler_port = sys.argv[2]
worker_port = sys.argv[3]
objstore_port = sys.argv[4]
worker.global_worker.connect(address(ip_address, scheduler_port), address(ip_address, worker_port), address(ip_address, objstore_port))
worker.global_worker.register_function("hello_world", print_string, 1)
worker.global_worker.register_function("handle_int", handle_int, 2)