io.getquill.util.Using.Manager
See theManager companion object
A resource manager.
Resources can be registered with the manager by calling acquire acquire
; such resources will be released in reverse order of their acquisition when the manager is closed, regardless of any exceptions thrown during use.
See the main doc for Using Using
for full details of suppression behavior.
Attributes
- Note
-
It is recommended for API designers to require an implicit
Manager
for the creation of custom resources, and to callacquire
during those resources' construction. Doing so guarantees that the resource ''must'' be automatically managed, and makes it impossible to forget to do so. Example:class SafeFileReader(file: File)(implicit manager: Using.Manager) extends BufferedReader(new FileReader(file)) { def this(fileName: String)(implicit manager: Using.Manager) = this(new File(fileName)) manager.acquire(this) }
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article