mdedetrich commented on PR #2156: URL: https://github.com/apache/pekko/pull/2156#issuecomment-3261708862
> 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? The Java Stream itself blocks while its waiting for the next element (i.e. it stalls the current thread) which means its easy to make a deadlock if you expose the `InputStream`/`OutputStream` as a materialized element, as the materialized element needs to evaluate immediately (i.e. no blocking) before the stream starts but the pekko stream cannot start because the `InputStream` blocks until a receives the element (which it will never receive as the pekko stream hasn't started yet), hence the deadlock. I experienced this myself, not sure what the easiest way to deal with this is from an API don't shoot yourself in the foot perspective. -- 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: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org