Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-27 Fir de Conversatie skywind3000
skywind3000 wrote: > Bram Moolenaar wrote: > > > Skywind wrote: > > > > > Bram Moolenaar wrote: > > > > > This will not break the plugins, and will make ch_read better. > > > > > It could be used in a timer for congestion control manually. > > > > > > > > That changes what you get back, that is

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-27 Fir de Conversatie skywind3000
Bram Moolenaar wrote: > Skywind wrote: > > > Bram Moolenaar wrote: > > > > This will not break the plugins, and will make ch_read better. > > > > It could be used in a timer for congestion control manually. > > > > > > That changes what you get back, that is a bit strange. > > > How about

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-26 Fir de Conversatie Bram Moolenaar
Skywind wrote: > Bram Moolenaar wrote: > > > This will not break the plugins, and will make ch_read better. > > > It could be used in a timer for congestion control manually. > > > > That changes what you get back, that is a bit strange. > > How about adding a function that returns whether

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-26 Fir de Conversatie skywind3000
Bram Moolenaar wrote: > > This will not break the plugins, and will make ch_read better. > > It could be used in a timer for congestion control manually. > > That changes what you get back, that is a bit strange. > How about adding a function that returns whether there is something to > read?

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-26 Fir de Conversatie Bram Moolenaar
Skywind wrote: > What about provide an option "nl" in ch_read to make it better ? > > :call ch_read(mych, {"timeout": 0, "nl":1}) > > returns "abc\n" for a line "abc" > returns "\n" for an empty line > returns "" for not enough data > > This will not break the plugins, and will make ch_read

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-26 Fir de Conversatie Bram Moolenaar
Skywind wrote: > Thanks for the patch, > > I wrote a test : > (benchjob.vim for starting job, benchjob.py for printing 8 lines) > > --- > benchjob.vim: > > function! MyCallback(job, text) > " make cpu a little busy > for i in range(100) >

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-25 Fir de Conversatie skywind3000
What about provide an option "nl" in ch_read to make it better ? :call ch_read(mych, {"timeout": 0, "nl":1}) returns "abc\n" for a line "abc" returns "\n" for an empty line returns "" for not enough data This will not break the plugins, and will make ch_read better. It could be used in a timer

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-25 Fir de Conversatie skywind3000
Thanks for the patch, I wrote a test : (benchjob.vim for starting job, benchjob.py for printing 8 lines) --- benchjob.vim: function! MyCallback(job, text) " make cpu a little busy for i in range(100) for j in range(10)

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-24 Fir de Conversatie Bram Moolenaar
Skywind wrote: > The callback of "out_cb" is convenience to use, but has performance issue: > Gui gets freezed if the background job continues outputing massive data (eg, > grep a high frequency word "to" on the documents root, or some crazy stl > errors). > > Vim is busy in receiving the

Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-23 Fir de Conversatie skywind3000
skywind3000 wrote: > The callback of "out_cb" is convenience to use, but has performance issue: > Gui gets freezed if the background job continues outputing massive data (eg, > grep a high frequency word "to" on the documents root, or some crazy stl > errors). > > Vim is busy in receiving the

"ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-23 Fir de Conversatie skywind3000
The callback of "out_cb" is convenience to use, but has performance issue: Gui gets freezed if the background job continues outputing massive data (eg, grep a high frequency word "to" on the documents root, or some crazy stl errors). Vim is busy in receiving the data and invoking "out_cb" which