UsingOps

org.llm4s.core.safety.UsingOps
object UsingOps

Resource management helpers for automatic cleanup This file legitimately needs try-finally for low-level resource management

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
UsingOps.type

Members list

Value members

Concrete methods

def using[A <: AutoCloseable, B](resource: A)(f: A => B): B

Manages resources that implement AutoCloseable Automatically closes the resource after use, even if an exception occurs

Manages resources that implement AutoCloseable Automatically closes the resource after use, even if an exception occurs

Value parameters

f

Function to apply to the resource

resource

The AutoCloseable resource to manage

Attributes

Returns

Result of applying the function

def using2[A <: AutoCloseable, B <: AutoCloseable, C](resource1: A, resource2: B)(f: (A, B) => C): C

Manages multiple resources with proper cleanup order Resources are closed in reverse order of creation

Manages multiple resources with proper cleanup order Resources are closed in reverse order of creation

Attributes