I spent some time playing with this, and one thing I noticed is that
there's no way to get the status of a channel "out of band".  For example,
when I was writing my little Perl server for Vim to communicate with
occasionally it would die on me, but my Vim script didn't know that until
one of the ch_* commands threw an error, which I currently handle using
either :silent or :try/:catch/:endtry.  A ch_status() or something like it
that returns a dictionary of info about the channel would be useful. For
example, it could indicate the mode, callback, waittime, last message
number sent/received, etc. and if the channel is dead it could just return
an empty dictionary.

The other thing I noticed is that even though it says in the documentation
that you can specify a callback in ch_open, it doesn't actually call the
callback--I still have to specify the callback on every call to
ch_sendexpr.  I'm assuming it's just not implemented yet and I should be
patient.

A feature I wouldn't mind seeing added, but would understand if it wasn't
due to possible drawbacks is a flag to ch_open to make it automatically try
reconnecting a specified number of times if the channel dies without
ch_close being called.  Or perhaps it would be better to allow a handler to
be defined for when the channel dies without ch_close being called.

- Christian

On Sun, Feb 7, 2016 at 8:18 AM, Bram Moolenaar <[email protected]> wrote:

>
> James McCoy wrote:
>
> > On Sun, Feb 07, 2016 at 02:27:53PM +0100, Bram Moolenaar wrote:
> > >
> > > Patch 7.4.1274
> > > Problem:    Cannot run a job.
> > > Solution:   Add job_start(), job_status() and job_stop(). Currently
> only works
> > >             for Unix.
> >
> > Have you had a chance to look at the job API that neovim implemented?
> >
> > https://neovim.io/doc/user/eval.html#jobclose%28%29
> >
> > It would be nice to not have unnecessary divergence.
>
> Now that the basic channel and job support is there, I would like to
> invite plugin writers to give feedback.  We probably need some more
> features and/or change how things work.
>
> NeoVim is free to follow.  It appears NeoVim's ideas about jobs and
> channels are quite different.  And it seems to be quite complicated.
>
> --
> "Hit any key to continue" is a lie.
>
>  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net
>  \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org
> ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org
> ///
>
> --
> --
> 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].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Christian J. Robinson <[email protected]>

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui