ResourceIOOps

Representation of a resource operation, with the common Monad operations.

class Object
trait Matchable
class Any
object ResourceIO.type

Value members

Concrete methods

def accessResource[A](f: Resource => A): ResourceIO[A]

Store an unsafe resource operation in a ResourceIO.

Store an unsafe resource operation in a ResourceIO.

def withInputStream[A](f: InputStream => A): ResourceIO[Try[A]]

Loads the resource synchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Loads the resource synchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

def withInputStreamAsync[A](f: InputStream => A): ResourceIO[Poll[A]]

Loads the resource asynchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Loads the resource asynchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

def withSource[A](f: Source => A): ResourceIO[Try[A]]

Loads the resource synchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStream instead.

Loads the resource synchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStream instead.

def withSourceAsync[A](f: Source => A): ResourceIO[Poll[A]]

Loads the resource asynchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStreamAsync instead.

Loads the resource asynchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStreamAsync instead.

Concrete fields

Path to the resource

Path to the resource