Same question here.

I'm trying to write a test code for our project, which temporarily creates a
TServer object and serve() it on a thread, and perform test codes, and then
terminate it. But I just can't figure out howto. I think if TServer
implementation had stop() method, I can try: (psuedo code)

*import thread*
*server_instance, handler_instance = get_thrift_server()*
*
*
*thread.start_new_thread(server_instance.serve, tuple())*
*
*
*run_tests()*
*
*
*server_instance.stop()*

I tried "sys.exit(0)" and many other ways, but all failed to terminate the
thread which runs TServer.serve() ... Any suggestions?

--
Francisco Byun

2011/8/11 Kyle <[email protected]>

> There doesn't seem to be a 'stop' method in any of the python TServer
> implementations. I know the method exists in the Java API.
> I'd like to have a second thread watching activity, and when the
> server seems inactive, hit the stop button and shutdown the program.
> But all of the server loops are 'while True' and waiting for an
> exception.
>
> Any ideas?
>
> Kyle
>

Reply via email to