GitHub user mdedetrich edited a comment on the discussion: 
`StreamConverters.asInputStream` not workable when using broadcast with 
`ByteString` source?

> Looking at the InputStreamStage, it does look like it may have been written 
> with InputStream semantics - supporting a one time read and that's it. For 
> Fan-Out scenarios, it feels better to materialize a ByteString which is 
> re-readable - you can get more than 1 InputStream from the ByteString and 
> read the data more than once.

Indeed but if I understand you correctly, thats why there is `Broadcast` (which 
`alsoToMat` uses internally), the entire point of that is to fan out the source 
byte stream so that one copy is sent to the uploadSink and another copy is sent 
to the `StreamConverters.inputStream()`'s inputStream so that this shouldn't be 
an issue since `InputStream` will be working on a copy of the original source.

Or maybe I am misunderstanding something here?

EDIT: I just did some searching and maybe I should be using 
[`BroadcastHub.Sink`](https://pekko.apache.org/japi/pekko/snapshot/org/apache/pekko/stream/javadsl/BroadcastHub.html)
 instead???

GitHub link: 
https://github.com/apache/pekko/discussions/1807#discussioncomment-12591979

----
This is an automatically sent email for notifications@pekko.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@pekko.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org
For additional commands, e-mail: notifications-h...@pekko.apache.org

Reply via email to