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
- All
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( ... ) @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] )
-
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[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
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
-
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(): 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()
-
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.