All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.sciss.lucre.Var.scala Maven / Gradle / Ivy

Go to download

Extension of Scala-STM, adding optional durability layer, and providing API for confluent and reactive event layers

There is a newer version: 4.6.6
Show newest version
/*
 *  Var.scala
 *  (Lucre 4)
 *
 *  Copyright (c) 2009-2021 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