3 ms·
This is only delightful when you are doing synchronous computation or you have async/await in the language. Until Loom is available, using this same pattern wit
by fnord123 6y ago
This is only delightful when you are doing synchronous computation or you have async/await in the language. Until Loom is available, using this same pattern with CompletableFuture breaks in the face of try-with-resources.
Also I don't think it's possible in Python using await since await is a prefix keyword so in your example .groupBy is not a method on Future so it won't work.
I love ReactiveX as much as anyone but these issues cheese me off.
Rust has await as a postfix operator so this pattern works flawlessly when mixing async and sync code.