trait ExtractableManagedResource[+A] extends ManagedResource[A]
This trait represents a resource that has been modified (or will be modified) inside an ARM block in such a way that the resulting value can be extracted outside of the "ManagedResource" monad. There are two mechanisms for extracting resources. One which returns an optional value, where None is returned if any error occurs during extraction. The other returns an Either where the left side contains any error that occured during extraction and the right side contains the extracted value.
- Alphabetic
- By Inheritance
- ExtractableManagedResource
- ManagedResource
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
acquireAndGet[B](f: (A) ⇒ B): B
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed.
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately, except in the case of an error. Upon error, the resource will be closed, and then the originating exception will be thrown.
Note: This method will throw the last exception encountered by the managed resource, whatever this happens to be.
- f
A function to execute against the handle returned by the resource
- returns
The result of the passed in function
- Definition Classes
- ManagedResource
-
abstract
def
acquireFor[B](f: (A) ⇒ B): ExtractedEither[List[Throwable], B]
Aquires the resource for the Duration of a given function, The resource will automatically be opened and closed.
Aquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately in an Either container. This container will hold all errors, if any occurred during execution, or the resulting value.
- f
A function to execute against the raw resource.
- returns
The result of the function (right) or the list of exceptions seen during the processing of the resource (left).
- Definition Classes
- ManagedResource
-
abstract
def
and[B](that: ManagedResource[B]): ManagedResource[(A, B)]
Creates a new resource that is the aggregation of this resource and another.
Creates a new resource that is the aggregation of this resource and another.
- that
The other resource
- returns
A resource that is a tupled combination of this and that.
- Definition Classes
- ManagedResource
-
abstract
def
apply[B](f: (A) ⇒ B): B
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed.
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately, except in the case of an error. Upon error, the resource will be closed, and then the originating exception will be thrown.
Note: This method will throw the last exception encountered by the managed resource, whatever this happens to be.
- f
A function to execute against the handle returned by the resource
- returns
The result of the passed in function
- Definition Classes
- ManagedResource
-
abstract
def
either: ExtractedEither[Seq[Throwable], A]
This method is used to extract the resource being managed.
This method is used to extract the resource being managed.
This allows you to pull information out of the Managed resource, as such, the Resource will not be "available" after this method call.
-
abstract
def
foreach(f: (A) ⇒ Unit): Unit
This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.
This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning. Note: This method *will* open and close the resource, performing the body of the method immediately.
- f
The function to apply against the raw resource.
- Definition Classes
- ManagedResource
-
abstract
def
map[B](f: (A) ⇒ B): ExtractableManagedResource[B]
This method is used to perform operations on a resource while the resource is open.
This method is used to perform operations on a resource while the resource is open.
- f
The transformation function to apply against the raw resource.
- returns
A new ManagedResource with the translated type or some other type if an appropriate translator was found.
- Definition Classes
- ManagedResource
-
abstract
def
opt: Option[A]
This method is used to extract the resource being managed.
This method is used to extract the resource being managed.
This allows you to pull information out of the Managed resource, as such, the Resource will not be "available" after this method call.
-
abstract
def
toFuture(implicit context: ExecutionContext): Future[A]
This method creates a Future that will perform operations within the context of an "open" resource.
This method creates a Future that will perform operations within the context of an "open" resource. Execution of Future will hold error as Failure, otherwise result will be inside a Success.
- Definition Classes
- ManagedResource
-
abstract
def
toTraversable[B](implicit ev: <:<[A, TraversableOnce[B]]): Traversable[B]
This method creates a Traversable in which all performed methods are done within the context of an "open" resource.
This method creates a Traversable in which all performed methods are done within the context of an "open" resource. Note: Every iteration will attempt to open and close the resource!
- returns
A Traversable of elements of type B.
- Definition Classes
- ManagedResource
-
abstract
def
tried: Try[A]
This method is used to extract the resource being managed.
This method is used to extract the resource being managed.
This allows you to pull information out of the Managed resource, as such, the reosurce will not be "available" after this method call.
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[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
abstract
def
flatMap[B](f: (A) ⇒ B): ManagedResource[B]
[use case]
[use case]- f
The transformation function to apply against the raw resource.
- returns
A new ManagedResource with the translated type or some other type if an appropriate translator was found.
- Definition Classes
- ManagedResource
Full Signatureabstract def flatMap[B](f: (A) ⇒ ManagedResource[B]): ManagedResource[B]
-
abstract
def
flatMap[B](f: (A) ⇒ Traversable[B]): Traversable[B]
[use case]
[use case]- f
The transformation function to apply against the raw resource.
- returns
A new ManagedResource with the translated type or some other type if an appropriate translator was found.
- Definition Classes
- ManagedResource
Full Signatureabstract def flatMap[B](f: (A) ⇒ ManagedResource[B]): ManagedResource[B]
-
abstract
def
flatMap[B](f: (A) ⇒ ManagedResource[B]): ManagedResource[B]
[use case]
[use case]- f
The transformation function to apply against the raw resource.
- returns
A new ManagedResource with the translated type or some other type if an appropriate translator was found.
- Definition Classes
- ManagedResource
Full Signatureabstract def flatMap[B](f: (A) ⇒ ManagedResource[B]): ManagedResource[B]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
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( ... )