abstract class ReleaseMap extends Serializable
A ReleaseMap
represents the finalizers associated with a scope.
The design of ReleaseMap
is inspired by ResourceT, written by Michael
Snoyman @snoyberg.
(https://github.com/snoyberg/conduit/blob/master/resourcet/Control/Monad/Trans/Resource/Internal.hs)
- Alphabetic
- By Inheritance
- ReleaseMap
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ReleaseMap()
Type Members
-
abstract
type
Key
An opaque identifier for a finalizer stored in the map.
Abstract Value Members
-
abstract
def
add(finalizer: Finalizer)(implicit trace: ZTraceElement): UIO[Finalizer]
Adds a finalizer to the finalizers associated with this scope.
Adds a finalizer to the finalizers associated with this scope. If the finalizers associated with this scope have already been run this finalizer will be run immediately.
The finalizer returned from this method will remove the original finalizer from the map and run it.
-
abstract
def
addIfOpen(finalizer: Finalizer)(implicit trace: ZTraceElement): UIO[Option[Key]]
Adds a finalizer to the finalizers associated with this scope.
Adds a finalizer to the finalizers associated with this scope. If the scope is still open, a Key will be returned. This is an opaque identifier that can be used to activate this finalizer and remove it from the map. from the map. If the scope has been closed, the finalizer will be executed immediately (with the Exit value with which the scope has ended) and no Key will be returned.
-
abstract
def
get(key: Key)(implicit trace: ZTraceElement): UIO[Option[Finalizer]]
Retrieves the finalizer associated with this key.
-
abstract
def
release(key: Key, exit: Exit[Any, Any])(implicit trace: ZTraceElement): UIO[Any]
Runs the specified finalizer and removes it from the finalizers associated with this scope.
-
abstract
def
releaseAll(exit: Exit[Any, Any], execStrategy: ExecutionStrategy)(implicit trace: ZTraceElement): UIO[Any]
Runs the finalizers associated with this scope using the specified execution strategy.
Runs the finalizers associated with this scope using the specified execution strategy. After this action finishes, any finalizers added to this scope will be run immediately.
-
abstract
def
remove(key: Key)(implicit trace: ZTraceElement): UIO[Option[Finalizer]]
Removes the finalizer associated with this key and returns it.
-
abstract
def
replace(key: Key, finalizer: Finalizer)(implicit trace: ZTraceElement): UIO[Option[Finalizer]]
Replaces the finalizer associated with this key and returns it.
Replaces the finalizer associated with this key and returns it. If the finalizers associated with this scope have already been run this finalizer will be run immediately.
-
abstract
def
updateAll(f: (Finalizer) ⇒ Finalizer)(implicit trace: ZTraceElement): UIO[Unit]
Updates the finalizers associated with this scope using the specified function.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()