Commits

Sven Hendriks committed ba547f7

serve() now expects^Cn object instead of a class

Comments (0)

Files changed (4)

 			b = int(b)
 			return a + b
 	
-	serve(9000, Handler)
+	serve(9000, Handler())
 
 Client
 ------

jrpc/examples/example_server.py

+from jrpc.server import serve
+
 class ExampleHandler():
 	def sum(self, a, b, c=0):
 		a = int(a)
 		c = int(c)
 		return a+b+c
 
+serve(9000, ExampleHandler())
+
         	                'server.socket_port': http_port,
 				'request.error_response': _handle_error,
 	                       })
-	cherrypy.quickstart(JRPCServer(handler()))
+	cherrypy.quickstart(JRPCServer(handler))
 

jrpc/tests/test_client_server.py

 
 def test_client_server():
 	# start server in separate process
-	serverproc = Process(target=serve, args=(9000, Handler))
+	serverproc = Process(target=serve, args=(9000, Handler()))
 	serverproc.start()
 
 	# Give the server time to start up