Resource

trait Resource[A] extends AutoCloseable

Resource that can be closed.

Companion:
object
trait AutoCloseable
class Object
trait Matchable
class Any

Value members

Abstract methods

def close(): Unit
def get: A

Concrete methods

def wrapFuture[U](body: A => Future[U])(implicit ec: ExecutionContext): Future[U]

Wrap a Future with this resource. After the future completes, the resource will be closed

Wrap a Future with this resource. After the future completes, the resource will be closed