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

BusyWorker.doTask - incorrect behavior with code blocks #2

Closed
jpsacha opened this issue Nov 20, 2018 · 0 comments
Closed

BusyWorker.doTask - incorrect behavior with code blocks #2

jpsacha opened this issue Nov 20, 2018 · 0 comments

Comments

@jpsacha
Copy link
Member

jpsacha commented Nov 20, 2018

Consider this code

busyWorker.doTask("myTask") {
  op1()
  op2()
  op3()
}

One would expect that all 3 operations will be run on a separate thread. However, currently op1 and op2 will be executed on current thread, only op3 will be executed on a separate thread.

BusyWorker should not allow writing this type of code.

To fix this user has to write:

busyWorker.doTask("myTask") { () =>
  op1()
  op2()
  op3()
}
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

1 participant