Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1365

Thread safety of Source.queue

$
0
0

Is it safe to do something like this:

val (queue, source) = Source.queue[T](bufferSize, OverflowStrategy.backpressure).preMaterialize()


Future {
  // in reality, the queue would be passed off somewhere else, where items would be added to the 
  // queue from a different thread as events come in.
  (1...10).foreach(queue.offer(_))
  queue.complete()
}

doSomethingWithSource(source)

The documentation isn’t particularly clear on that.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1365

Trending Articles