These days the current API supports a number of ways of constructing a 
Source.

http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M3/?_ga=1.72893075.1209102577.1407799351#akka.stream.scaladsl.Source$

Based upon these available methods, if I needed to supply 0 or 1 elements 
based upon some business logic, I would probably create a custom iterator 
implementation.  Your business logic can then determine whether to emit an 
element or provide hasNext=false, which I believe will signal that the 
source is empty and trigger a teardown of the materialized flow.

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to