Skywind wrote:

> Bram Moolenaar wrote´╝Ü
> > When writing the test I also had problems with messages being dropped.
> > I thought that adding a close callback should fix it, but perhaps there
> > is another situation where they are still dropped.
> > 
> > Can you enable the channel log and see where the messages are dropped?
> > 
> 
> I reduced loop times in timerjob.py from 80000 to 100 times
> 
> The full file is still too long, I have uploaded it on gist:
> https://gist.github.com/skywind3000/3a2f6016240e33e97587e1181563b163 
> 
> Here is an abbreviated version:

Thanks.  I had a try myself to get the full log.  Apparently the close
callback is called quite soon, and since you only read a line every 10
msec you miss all the ones after a second.

You can improve this a lot by changing:

   if ch_canread(ch)
        let text = ch_read(ch, {'timeout':0})
        caddexpr text
        cbottom
    endif

To:

   if ch_canread(ch)
        while ch_canread(ch)
                let text = ch_read(ch, {'timeout':0})
                caddexpr text
        endwhile
        cbottom
    endif

But, you might still miss some messages if the job exits early.

I suppose we will need to add an option to tell Vim that you will read
the messages, not using a callback.  I think this should do it:

"drop"          Specifies when to drop messages:
                    "auto"      When there is no callback to handle a message.
                                The "close_cb" is also considered for this.
                    "never"     All messages will be kept.



-- 
hundred-and-one symptoms of being an internet addict:
60. As your car crashes through the guardrail on a mountain road, your first
    instinct is to search for the "back" button.

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui