de.sciss.lucre.Var.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lucre-base_sjs1_2.13 Show documentation
Show all versions of lucre-base_sjs1_2.13 Show documentation
Extension of Scala-STM, adding optional durability layer, and providing API for confluent and reactive event layers
/*
* Var.scala
* (Lucre 4)
*
* Copyright (c) 2009-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.lucre
import de.sciss.serial.Writable
trait Source[-T, +A] {
def apply()(implicit tx: T): A
}
trait Sink[-T, -A] {
def update(value: A)(implicit tx: T): Unit
}
trait Ref[-T, A] extends Source[T, A] with Sink[T, A] {
def swap(value: A)(implicit tx: T): A
}
trait Var[-T, A] extends Ref[T, A] with Writable with Disposable[T]
© 2015 - 2024 Weber Informatics LLC | Privacy Policy