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

Updated AsyncWorker (and defined AsyncProcessor) so that we get back … #212

Merged
merged 4 commits into from
Apr 22, 2020

Conversation

josephcarroll
Copy link
Collaborator

…Futures for processed tasks. Those futures can then be used to block on and wait if desired.

Exceptions during async processing are now also caught and logged, rather than causing the thread to die and leaving us in a bad state.

…Futures for processed tasks. Those futures can then be used to block on and wait if desired.

Exceptions during async processing are now also caught and logged, rather than causing the thread to die and leaving us in a bad state.
@devgianlu
Copy link
Member

I think there's still the issue that the task will be interrupted when the worker is closed. The problem originated from #155 where I need to send an event before shutting everything down, if it's not quick enough an exception will be thrown which is not a big deal because the request itself has been sent already.

I was just wondering whether there was a way to get around it.

@josephcarroll
Copy link
Collaborator Author

Changed to a simpler Executor based approach. This means when you call close it will wait 1 minute for currently running tasks to complete.

@devgianlu devgianlu merged commit 373e389 into librespot-org:dev Apr 22, 2020
@josephcarroll josephcarroll deleted the async-worker-futures branch April 22, 2020 14:49
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

Successfully merging this pull request may close these issues.

2 participants