I really don't like repeating myself. But you can't just determine from the call site what that thing you're calling does with your closure.
So if you want to be sure, you have two options:
Inspect the entire tree of code into whatever you're using and make sure the implementation doesn't call from another thread. Make sure to repeat that process every time you update your dependencies.
1
u/[deleted] Mar 22 '21
I really don't like repeating myself. But you can't just determine from the call site what that thing you're calling does with your closure.
So if you want to be sure, you have two options:
Inspect the entire tree of code into whatever you're using and make sure the implementation doesn't call from another thread. Make sure to repeat that process every time you update your dependencies.
Don't use closures.
Which seems more possible?