Strategies or support for reusing parts of a Twisted application?

I wrote a specialized JSON-RPC server and just started working in the application logic and found it constantly annoying to constantly stop / restart the server to make certain changes.

I used to have a handler that ran intervals to compare the modified timestamps of the module with the last check, and then reload the module as needed. Unfortunately, I do not believe that it will work correctly.

Is there a way to stop the reactor and restart it the same as Paster Reloadable HTTPServer?

+3
source share
2 answers

Twisted - twisted.python.rebuild, , , .

. SO: python

+2

- paster reloader, :

  • / , fork/spawn .
  • .
  • , . , .

, - , / - , .

:

, subprocess.Popen() , stdin/stdout. stdin ( , . twisted.internet.stdio, , stdio, ).

, , - stdin , . . , , - .

( , )

+1

Source: https://habr.com/ru/post/1727734/


All Articles