Hi,

I'm stumbling over the behaviour of OutputStreamSubscriber as instantiated 
by StreamConverters.fromOutputStream:
In the case that my stream fails, I need to clean up after my operations, 
but the cleanup depends on the stream being closed first.

But OutputStreamSubscriber completes the underlying promise instantly with 
a "Failure" IOResult if it receives errors from up- or downstream, and then 
tries to complete the promise again in postStop().
This means that (a) I can't wait for the stream to be closed as postStop is 
async and (b) I get an exception from postStop for the "error during 
closing stream" case since the promise is already completed.

(1) What's the correct pattern to make sure the OutputStream is closed? 
Should I keep an outside reference to it and manually close it? Or can I 
somehow wait for postStop()?
(2) Is the second, irregular completion of the promise in 
OutputStreamSubscriber intended behaviour? Why does the exceptional case in 
postStop() not trySuccess() rather than success()?

Thanks,
Urs

-- 
>>>>>>>>>>      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