One pretty easy answer to this seems to be to use Http().singleRequest(...) 
to construct my own flow (using mapAsyncUnordered) with the behaviour I 
desire. I was concerned that singleRequest might have worse performance 
than the flow-based interface, but after a look at the source code, they 
both seem to be fairly thin wrappers around the same implementation. This 
does mean, for better or worse, that all requests would have to have 
absolute paths.

On Tuesday, April 19, 2016 at 11:36:46 AM UTC-4, Arron Norwell wrote:
>
> Hi,
>
> I am trying to use akka-http's host-level client-side 
> Http().cachedHostConnectionPool flow as part of a larger stream for which 
> items in the stream may have previously failed, and so it wouldn't make 
> sense to send an HTTP request. In other words, I really want a flow with 
> type something like Flow[(Try[HttpRequest], Context)], (Try[HttpResponse], 
> Context), NotUsed], for which the failure would be propagated.
>
> In general, this seems hard to do using akka-stream. More generally, I'd 
> like to do something like, given a Flow[A,B,NotUsed], construct a new 
> Flow[Try[A], Try[B], NotUsed] that would perform the operation of the 
> original flow only if the input item was a Success. Otherwise, it would 
> propagate the error. 
>
> I don't see an easy way to accomplish this. Is this the right way to be 
> approaching single-item failure propagation in a stream? Is there any kind 
> of fan-out stage that routes items downstream based on a predicate? Any 
> guidance would be appreciated.
>
> Arron
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to