abstract class Resource[Context, +A] extends AnyRef
A Resource is a Future that can be (asynchronously) released and will also release automatically upon failure.
- A
The type of value being protected as a Resource.
- Self Type
- Resource[Context, A]
- Alphabetic
- By Inheritance
- Resource
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Resource()(implicit arg0: HasExecutionContext[Context])
Abstract Value Members
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(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def flatMap[B](f: (A) => R[B])(implicit context: Context): R[B]
Just like Futures, Resources can be chained.
- def flatten[B](implicit nestedEvidence: <:<[A, R[B]], context: Context): R[B]
A nested resource can be flattened.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) => B)(implicit context: Context): R[B]
The underlying Future value in a Resource can be transformed.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def transform[B](f: (Try[A]) => Try[B])(implicit context: Context): R[B]
Creates a new Resource by applying the specified function to the result of this Resource.
Creates a new Resource by applying the specified function to the result of this Resource. If there is any non-fatal exception thrown when 'f' is applied then that exception will be propagated to the resulting future.
- def transformWith[B](f: (Try[A]) => R[B])(implicit context: Context): R[B]
Creates a new Resource by applying the specified function, which produces a Resource, to the result of this Resource.
Creates a new Resource by applying the specified function, which produces a Resource, to the result of this Resource. If there is any non-fatal exception thrown when 'f' is applied then that exception will be propagated to the resulting future.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withFilter(p: (A) => Boolean)(implicit context: Context): R[A]
A Resource's underlying value can be filtered out and result in a Resource with a failed Future.
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated