# Add the websocket server params = WebsocketServerComms.MethodMeta.prepare_input_map(port=WSPORT) comms = WebsocketServerComms(process, params) process.add_comms(comms) # We daemonise the server by double forking, but we leave the controlling # terminal and other file connections alone. if False and os.fork(): # Exit first parent sys.exit(0) # Do second fork to avoid generating zombies if False and os.fork(): sys.exit(0) # Make the parts by querying the PandABox params = hardware_collection.MethodMeta.prepare_input_map(mriPrefix="P", hostname=HOSTNAME, port=PORT) _, parts = hardware_collection(process, params) # Make a controller for the top level params = ManagerController.MethodMeta.prepare_input_map(mri="P", configDir="/tmp") controller = ManagerController(process, parts, params) # Start the server for comms in process.comms: comms.start() process.recv_loop()
sf = SyncFactory("Sync") process = Process("Process", sf) # Add the websocket server params = WebsocketServerComms.MethodMeta.prepare_input_map(port=WSPORT) comms = WebsocketServerComms(process, params) process.add_comms(comms) # We daemonise the server by double forking, but we leave the controlling # terminal and other file connections alone. if False and os.fork(): # Exit first parent sys.exit(0) # Do second fork to avoid generating zombies if False and os.fork(): sys.exit(0) # Make the parts by querying the PandABox params = hardware_collection.MethodMeta.prepare_input_map( mriPrefix="P", hostname=HOSTNAME, port=PORT) _, parts = hardware_collection(process, params) # Make a controller for the top level params = ManagerController.MethodMeta.prepare_input_map(mri="P") controller = ManagerController(process, parts, params) # Start the server for comms in process.comms: comms.start() process.recv_loop()