Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancellation Token for SearchAsync #96

Open
garybrowndev opened this issue Apr 11, 2019 · 1 comment
Open

Cancellation Token for SearchAsync #96

garybrowndev opened this issue Apr 11, 2019 · 1 comment

Comments

@garybrowndev
Copy link

It would be really great if SearchAsync took a cancellation token. When using this library inside of a Windows Service, you get an annoying behavior where when you try and stop the Windows service, if your code is inside the SearchAsync function, it blocks the whole app from closing until it comes out. When in the Windows Service manager, the "Stopping Service" dialog is popped up until SearchAsync finishes. This is due to, I think, the line in SearchAsync where its doing this:
await TaskEx.Delay(searchWaitTime).ConfigureAwait(false);

All you would do is add a cancellation token to the SearchAsync functions, and pass that along into the TaskEx.Delay() and that should fix it. What do you think?

@Yortw
Copy link
Owner

Yortw commented Apr 22, 2019

Hi,

This seems like a good idea. I'd be happy to look at a PR, otherwise I'll have a look at this next time I'm in the code, but not sure when that will be, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants