raboof commented on PR #2156: URL: https://github.com/apache/pekko/pull/2156#issuecomment-3261703293
> I think the `asStream` can be non-blocking, only triggering a pull when there is a `hasNext` request, and letting the poller who consumes the Java stream wait on the condition, the current is a bit complex but still never block the queue, but the poller, so this method should be safe. Gotcha, so `asInputStream` and `asOutputStream` are dangerous but `asJavaStream` is safe? That might be a good reason to expose it directly on `Sink`. I see the original `asJavaStream` already had the warning "Be aware that Java Stream blocks current thread while waiting on next element from downstream.". That sounds confusing to me. Is it waiting for an element from upstream, or demand from downstream? I see you have added "As it is interacting wit blocking API the implementation runs on a separate dispatcher configured through the ``pekko.stream.blocking-io-dispatcher``." to the javadoc/scaladoc, but which implementation is that? > I think Pekko should make code smooth brain just as ZIO and Spring :), which actually will cover 80% the daily usage. I agree, we should be making things "as simple as possible, but not simpler" :smile: -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
