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

gopher.impl.Writer.scala Maven / Gradle / Ivy

Go to download

scala-gopher: asynchronous implementation of CSP ( go-like channels/selectors ) in scala

The newest version!
package gopher.impl

import scala.util.Try

trait Writer[A] extends Expirable[(A,Try[Unit]=>Unit)]


class SimpleWriter[A](a:A, f: Try[Unit]=>Unit) extends Writer[A]:

  def canExpire: Boolean = false

  def isExpired: Boolean = false

  def capture(): Option[(A,Try[Unit]=>Unit)] = Some((a,f))

  def markUsed(): Unit = ()

  def markFree(): Unit = ()






© 2015 - 2025 Weber Informatics LLC | Privacy Policy