gopher.impl.SPSCBuffer.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-gopher_3.0.0-RC2 Show documentation
Show all versions of scala-gopher_3.0.0-RC2 Show documentation
scala-gopher: asynchronous implementation of CSP ( go-like channels/selectors ) in scala
The newest version!
package gopher.impl
import gopher._
/**
* Buffer. access to buffer is exclusive by owner channel,
* different loops can start in different threads but only one loop can be active at the samw time
**/
trait SPSCBuffer[A] {
def isEmpty(): Boolean
def startRead(): A
def finishRead(): Boolean
def isFull(): Boolean
// prcondition: !isFull()
def write(a: A): Boolean
// set local state from published
def local(): Unit
// make buffer be readable from other thread than
def publish(): Unit
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy