mitogen/tests/data/self_contained_program.py

19 lines
313 B
Python
Raw Normal View History

2016-08-17 09:32:50 +00:00
"""
I am a self-contained program!
"""
2017-09-16 07:15:25 +00:00
import mitogen.master
2016-08-17 09:32:50 +00:00
def repr_stuff():
return repr([__name__, 50])
2017-09-17 15:03:43 +00:00
def main(router):
context = router.local()
print context.call(repr_stuff)
2016-08-17 09:32:50 +00:00
if __name__ == '__main__' and mitogen.is_master:
2017-09-17 15:03:43 +00:00
import mitogen.utils
mitogen.utils.run_with_router(main)