puddle

Types

pub type Message(resource_type, result_type) {
  Shutdown
  Utilize(
    fn(resource_type) -> result_type,
    reply_with: process.Subject(result_type),
  )
}

Constructors

  • Shutdown
  • Utilize(
      fn(resource_type) -> result_type,
      reply_with: process.Subject(result_type),
    )
pub opaque type Puddle(resource_type, result_type)

Functions

pub fn checkout(puddle: Puddle(a, b)) -> Result(
  #(#(Int, Subject(Message(a, b))), Puddle(a, b)),
  Nil,
)
pub fn new(size: Int, new_resource: fn() -> Result(a, Nil)) -> Result(
  Puddle(a, b),
  Nil,
)
pub fn put_back(puddle: Puddle(a, b), subject_id: Int) -> Puddle(
  a,
  b,
)
Search Document