As the title says, what’s the difference between those two functions on ProcessProtocol classes? Documentation is a bit sparse on when should one be used instead of another?
Preferably, I’m looking for some examples of use cases that demonstrate that.
I guess the documentation is somewhat sparse on this point. If no such ticket exists, please feel free to file a ticket to improve the API docs.
processExitedis invoked when a process has exited in the formal process-management sense, i.e. calledexit()or returned frommain().However, this is not always what you want. Sometimes a process spawns a subprocess, hands off its stdin and stdout, delegates responsibility for producing the data that you (the spawning parent process, in this case) wants, and then
exit()s because it’s done setting things up.processEndedis invoked when a process has both exited and finished doing all the I/O on its managed file descriptors (stdin,stdout, andchildFDs) and they’ve been closed. If you’re spawning something just to read its output, this is the notification you most likely care about.