It is hard to give much input without knowing the state of the code you
want to add this one time activity into. I'm inclined to think you could
use a factory function that accepts the credentials and returns a stream.
Have a special case message be processed at the start by prepending it,
thus processing it first. You may need to enrich the types at the start of
the stream to drive the special handling logic, such as wrapping in
'either' or donation specific case classes.

Hope this helps,
James

On Sep 27, 2016 5:27 AM, <gor...@8kdata.com> wrote:

> I am an Akka Stream newbie and this kind of problems is the main reason
> why we are not using Akka Streams more widely. I also feel the lack of
> documentation in this kind of cases.
>
> A solution I can imagine is to have two sources, one of them used when the
> connection is not handshaked and the other one after that. Then, you can
> merge both streams and finally your code should decide where to send the
> request.
>
> El sábado, 24 de septiembre de 2016, 0:33:42 (UTC+2), Ryon Day escribió:
>>
>> Hello! A few quick questions. I've gone over all of the available
>> examples for Akka Streams, and I have not yet been able to find anything
>> about two use cases:
>>
>> Doing something one time per stream upon connection.
>>
>> Currently I'm trying to implement a primitive IRC client using
>> Akka-Streams. This requires, ONCE upon connection to send a nickname and an
>> optional password, and the server will reply. For the life of me, I cannot
>> find anything that would tell me how to do this seemingly common use case.
>> All examples (such as the echo server etc) seem to concentrate on doing
>> either one thing, or every one of a series of steps for the life of a
>> stream. There seems to be nothing to tell a particular flow step to execute
>> only once and to say, terminate the stream upon indication of failure.
>>
>> I also have seen nothing about automatically re-running a stream if a
>> connection is interrupted.
>>
>> Apologies if this has been gone over, but none of the documentation or
>> examples seem to be particularly helpful in this regard. Is Akka-Streams
>> not the correct choice for modeling protocols that have different stages to
>> them? am I conceptually missing something here?
>>
>> Thank you!
>>
>> --
> >>>>>>>>>> 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.
>

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