home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (FinalizerHandle.scala)

This example Scala source code file (FinalizerHandle.scala) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Scala by Example" TM.

Learn more about this Scala project at its project page.

Java - Scala tags/keywords

finalizerhandle, refcountedfinalizer

The FinalizerHandle.scala Scala example source code

package scalaz
package effect

/**
 * A handle to a finalizer that allows you to duplicate it to a parent region using "dup".
 * Duplicating a finalizer means that instead of being performed when the current region
 * terminates, it is performed when the parent region terminates.
 */
sealed abstract class FinalizerHandle[R[_]] {
  val finalizer: RefCountedFinalizer
}

object FinalizerHandle {
  def apply[R[_]](r: RefCountedFinalizer): FinalizerHandle[R] = finalizerHandle[R](r)

  def finalizerHandle[R[_]](r: RefCountedFinalizer): FinalizerHandle[R] =
    new FinalizerHandle[R] {
      val finalizer = r
    }
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala FinalizerHandle.scala source code file:



my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.