But doesn’t making assumptions about implementatio...
# coroutines
d
But doesn’t making assumptions about implementation lead to leaky abstractions?
d
Whether or not a method blocks it not part of the implementation but of the interface contract imho.
d
@diesieben07 imagine a typical
Logger
interface. Implementations often utilize I/O but you can hardly meet a non-blocking logger.
d
There is a difference between non-blocking and suspending.
Every suspending method should be non-blocking, but not every non-blocking method suspends. You can have a non-blocking method that instead of suspending returns e.g. a
CompletableFuture
or a
Deferred
.