Is there a FIFO stream in Scala?

后端 未结 3 887
野性不改
野性不改 2020-12-31 05:27

I\'m looking for a FIFO stream in Scala, i.e., something that provides the functionality of

  • immutable.Stream (a stream that can be finite and memorizes the ele
3条回答
  •  庸人自扰
    2020-12-31 06:03

    I'm assuming you're looking for something like java.util.concurrent.BlockingQueue?

    Akka has a BoundedBlockingQueue implementation of this interface. There are of course the implementations available in java.util.concurrent.

    You might also consider using Akka's actors for whatever it is you are doing. Use Actors to be notified or pushed a new event or message instead of pulling.

提交回复
热议问题