Marcin Szamotulski wrote:
> The ch_sendexpr requires a callback to run asynchronously. In my
> scenario I add a listener od the channel and still I'd like to run
> ch_sendexpr asynchronous, I can add the same callback as on the
> channel, but this seems not intuitive. I'd suggest to use a boolean
> option passed to ch_sendexpr to run asynchronously or not.
You can do it this way:
let channel = ch_open('localhost:8765', {'callback': "MyHandler"})
call ch_sendexpr(channel, 'hello!', {'callback': 0})
It's just above ":help channel-open". Hmm, I notice some examples for
ch_sendexpr() need to be updated to take the options dictionary.
I think this does what you want. It's a bit verbose perhaps. I first
had a string argument (which could be zero for no callback), but we want
to pass more options and the number of arguments would grow.
An alternative is to add more functions, e.g. ch_sendexpr_async(), but
that doesn't seem like a good idea.
--
ARTHUR: Well, I AM king...
DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By exploitin'
the workers -- by 'angin' on to outdated imperialist dogma which
perpetuates the economic an' social differences in our society! If
there's ever going to be any progress--
The Quest for the Holy Grail (Monty Python)
/// 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.