title: How to get a Subscriber and Publisher from a broadcasted Akka stream?
body: <p>I'm having problems in getting Publishers and Subscribers out of my flows when using more complicated graphs. My goal is to provide an API of Publishers and Subscribers and run the Akka streaming internally. Here's my first try, which works just fine.</p>
  
  <pre><code>val subscriberSource = Source.subscriber[Boolean]
  val someFunctionSink = Sink.foreach(Console.println)
  
  val flow = subscriberSource.to(someFunctionSink)
  
  //create Reactive Streams Subscriber
  val subscriber: Subscriber[Boolean] = flow.run()
  
  //prints true
  Source.single(true).to(Sink(subscriber)).run()
  </code></pre>
  
  <p>But then with a more complicated broadcast graph, I'm unsure as how to get the Subscriber and Publisher objects out? Do I need a partial graph?</p>
  
  <pre><code>val subscriberSource = Source.subscriber[Boolean]
  val someFunctionSink = Sink.foreach(Console.println)
  val publisherSink = Sink.publisher[Boolean]
  
  FlowGraph.closed() { implicit builder =&gt;
    import FlowGraph.Implicits._
  
    val broadcast = builder.add(Broadcast[Boolean](2))
  
    subscriberSource ~&gt; broadcast.in
    broadcast.out(0) ~&gt; someFunctionSink
    broadcast.out(1) ~&gt; publisherSink
  }.run()
  
  val subscriber: Subscriber[Boolean] = ???
  val publisher: Publisher[Boolean] = ???
  </code></pre>