I have a source source of type Source[ByteString, Any], and a sink sink of type Sink[ByteString, M], where M could be a Future[IOResult] or anything. When I run the following:
source.runWith(sink)
I get M as the result. I don't get any other useful information indicating that the stream was successful. If it's guaranteed to be Future[IOResult] it would be great, but the sink came from a generic typeclass and you can't determine the type at compile time.
However, all the instances of the typeclass are expected to report back on whether the operation was successful.
Or should I wrap the materialized type into a custom type, like Result[M], that I can easily manipulate? This might require a new typeclass of which instances of M have to be members (e.g. You should specify how Future[IOResult] converts to Result[Future[IOResult]]. Same for all the possible instances of M).