# Akka streaming broadcast

**URL:** <https://discuss.akka.io/t/akka-streaming-broadcast/3628>\
**Category:** Akka Streams & Alpakka\
**Created:** [March 11, 2019, 9:42pm UTC](https://discuss.akka.io/t/akka-streaming-broadcast/3628 "2019-03-11T21:42:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ze97286](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ze97286](https://discuss.akka.io/u/ze97286)\
**Post date:** [March 11, 2019, 9:42pm UTC](https://discuss.akka.io/t/akka-streaming-broadcast/3628/1 "2019-03-11T21:42:14Z")

</div>

Hello,

I have a grpc service where the server is streaming the result of some calculation to clients. The requirement is that all clients will get the same result. The calculation runs periodically.

What I have just now is the following:

```auto
val graph =
    Source
      .tick(delay,interval, SomeTick())
      .map(x=> calc(x))
      .preMaterialize()._2
      .toMat(BroadcastHub.sink(bufferSize = 256))(Keep.right)

val drainer = graph.run.runWith(Sink.ignore)

override def service(): Source[Something, NotUsed] = {
    graph.run
  }

```

I’m not sure if this is correct or not, as it seems to hang some of the time. Can anyone recommend the best approach for this?

Thanks!
