Hello!

I have managed to confuse myself over whether I should use close_cb or 
exit_cb to detect when I have received all the data from an external 
command's stdout.

I want to run "ps -axco command" in a job, gather the results from stdout, 
and then do something with the results.

My job_start() specifies an out_cb which is called with each line from 
stdout and accumulates the lines in a list.  My question is: what is the 
recommended way to know when I have all the data?

I have read the docs for exit_cb and close_cb many times but I can't figure 
it out.

exit_cb sounds right because it is called when the job ends; but apparently 
callbacks can still be called after exit_cb due to buffering, which seems 
to rule out exit_cb as a way of knowing when things are finished.  

close_cb is called when the channel is closed – but this seems like the 
wrong level of abstraction; I don't care about the channel.  Anyway, on the 
plus side, once close_cb is called no more data-handling callbacks will be 
called.  But it turns out I can't rely on close_cb because it isn't always 
called; in fact I am trying to debug a situation where a job from one 
plugin prevents another plugin's job's close_cb from being called.

I have looked at all the docs and read the job/channel test code, but I'm 
still not sure what the recommended way is for this kind of job.

Any help would be much appreciated!

Yours,
Andrew Stewart

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/05e01ae6-d0cb-42a7-a899-b401e3f2291bo%40googlegroups.com.

Raspunde prin e-mail lui