Opened 10 years ago

Last modified 10 years ago

#83 closed enhancement

threading / start processes using twisted: use ProcessProtocol — at Version 3

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 0.9.1
Component: Global Keywords:
Cc:

Description (last modified by Antoine Martin)

When starting a process and watching its output, we shouldn't do this in a separate thread but instead integrate the code with twisted main-loop (gtk/glib's actually) using ProcessProtocol?.

Also, when waiting for a process by pid (one we may not have launched ourselves), we should use gobject.child_watch_add(pid) which will also integrate with the main loop.

Places of interest:

  • ssh_key_util.generate_new_key: simple call_when_done callback
  • config_server.do_tunnel_connect_test: simple call_when_done callback (needs output and returncode)
  • ssh_command_monitor: needs every line to be parsed as they are received...
  • server_link.do_connect_to_server: re-implements wait_for_socket!!!

Change History (3)

comment:1 Changed 10 years ago by Antoine Martin

Description: modified (diff)
Milestone: 1.00.9.1
Owner: changed from Antoine Martin to Antoine Martin
Status: newaccepted
Summary: Make better use of twisted and its deferred: ProcessProtocol, sockets...start processes using twisted: use ProcessProtocol

comment:2 Changed 10 years ago by Antoine Martin

Description: modified (diff)
Summary: start processes using twisted: use ProcessProtocolthreading / start processes using twisted: use ProcessProtocol

comment:3 Changed 10 years ago by Antoine Martin

Description: modified (diff)
Note: See TracTickets for help on using tickets.