Skip to content

Conversation

@daviwil
Copy link
Contributor

@daviwil daviwil commented Feb 6, 2016

This change introduces a new AsyncDebouncer class which is able to gate
invocation requests to only occur after a specified interval. This class
is used to implement an OutputDebouncer which takes all output messages
written from the PowerShell host and buffers them. This causes many lines
of output written in a short time window to be sent as one OutputEvent
rather than writing individual events for each line.

Resolves #113.

@rkeithhill
Copy link
Contributor

Cool. Where/when did you learn all this async/await Fu? I've only seriously started using it in the past 5 months on a WPF app.

@daviwil
Copy link
Contributor Author

daviwil commented Feb 6, 2016

I learned a lot from the Concurrency in C# Cookbook. I had been using async/await for a while but only really started learning the nitty-gritty last year when I started this project. It's actually a pretty good model and can do quite a lot once you understand all the uses of Task.

@dfinke
Copy link
Contributor

dfinke commented Feb 6, 2016

Hmm, cool, didn't know about that book. I had Joe Duffy's work on my list. Thanks.

@rkeithhill
Copy link
Contributor

Thanks for the tip. That book will be on order from Amazon soon. :-)

@daviwil
Copy link
Contributor Author

daviwil commented Feb 6, 2016

It's pretty good! Also covers the TPL Dataflow library (which I haven't used yet) and Reactive Extensions (which I'd love to use but would require extra open-source approval :/)

@daviwil
Copy link
Contributor Author

daviwil commented Feb 6, 2016

Argh, this change is really biting me right now. Makes LanguageServer tests much more affected by output timing. Trying to figure out a predictable way of gathering output for comparison.

@rkeithhill
Copy link
Contributor

Can you bypass the delay for testing purposes?

@daviwil
Copy link
Contributor Author

daviwil commented Feb 6, 2016

Maybe, but I'd rather have the output be as real as possible just in case anything breaks. I've got a test fix in progress now, we'll see if it works out. If not, I may work around it for now.

This change introduces a new AsyncDebouncer class which is able to gate invocation requests to only occur after a specified interval. This class is used to implement an OutputDebouncer which takes all output messages written from the PowerShell host and buffers them. This causes many lines of output written in a short time window to be sent as one OutputEvent rather than writing individual events for each line. Resolves #113.
@daviwil daviwil force-pushed the daviwil/output-buffering branch from 97358ca to 9aee741 Compare February 7, 2016 20:58
@daviwil
Copy link
Contributor Author

daviwil commented Feb 7, 2016

I've got a much cleaner solution for the tests now, was also able to fix a couple issues thanks to Keith's comments elsewhere.

daviwil added a commit that referenced this pull request Feb 7, 2016
Add intervallic buffering of OutputEvent messages
@daviwil daviwil merged commit 41f2c3b into master Feb 7, 2016
@daviwil
Copy link
Contributor Author

daviwil commented Feb 7, 2016

Argh, looks like the solution wasn't totally bulletproof, the CI tests on master just failed. Probably a timing issue. I'm looking into it.

@daviwil daviwil deleted the daviwil/output-buffering branch February 16, 2016 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants