The problem is that a Sink has no outlets for data. They are on-way
consumers of elements, and emit none. You probably are looking for a Flow.


Brian Maso

On Fri, Feb 1, 2019 at 12:38 PM Zohar Etzioni <zohar.etzi...@gmail.com>
wrote:

> Hello,
>
> I'm trying to get a *new* source from an *existing* sink so I can use the
> source to stream over grpc. I found this example (
> https://github.com/akka/akka/issues/24853):
>
> /**
>   * Materializes into a sink connected to a source, i.e. the sink pushes into 
> the source:
>   *
>   * +----------+       +----------+
>   * >   Sink   |------>|  Source  >
>   * +----------+       +----------+
>   *
>   * Should be provided by Akka Streams, see 
> https://github.com/akka/akka/issues/24853.
>   */
> val connection: RunnableGraph[(Sink[String, NotUsed], Source[String, 
> NotUsed])] =
>   Source
>     .asSubscriber[String]
>     .toMat(Sink.asPublisher[String](fanout = false))(Keep.both)
>     .mapMaterializedValue {
>       case (sub, pub) => (Sink.fromSubscriber(sub), Source.fromPublisher(pub))
>     }
>
>
> However what I'm trying to do is to take an existing sink that already has
> a source connected to it, and create a new source to which the sink is
> feeding.
>
> It seems like a legitimate use case but I can't find any way to do it.
>
> Help would be much appreciated.
>
> Thanks,
> Zohar
>
> --
>
> *****************************************************************************************************
> ** New discussion forum: https://discuss.akka.io/ replacing akka-user
> google-group soon.
> ** This group will soon be put into read-only mode, and replaced by
> discuss.akka.io
> ** More details:
> https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
>
> *****************************************************************************************************
> >>>>>>>>>>
> >>>>>>>>>> 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.
>

-- 
*****************************************************************************************************
** New discussion forum: https://discuss.akka.io/ replacing akka-user 
google-group soon.
** This group will soon be put into read-only mode, and replaced by 
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*****************************************************************************************************
>>>>>>>>>> 
>>>>>>>>>>      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