Resource helpers.

basic-write!

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (basic-write! resource wch batch-size thread coll)

Type signature:
  • ((I IFailable IOpenAware) ⨯ java.nio.channels.WritableByteChannel ⨯ (Maybe Integer+) ⨯ (Maybe Thread+) ⨯ (Maybe IRed)) → (U Integer+ Postponed)

Performs a write to a given writable byte channel wch, returning number of bytes written or postponed object if channel is it non blocking mode. Thread local.

defreleasable

Available since version 1.0 (view source)

not referred automatically

MACRO (defreleasable name & args)

Defines a releasable resource (a resource with limited availability), which calls -release! when finalized. You must explicitly implement IReleasable. Resources usually also implement IConfigured and IOpenAware.

readable-resource-recipe

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (readable-resource-recipe resource rch batch-size thread)

Type signature:
  • ((I IFailable IOpenAware) ⨯ java.nio.channels.ReadableByteChannel ⨯ (Maybe Integer+) ⨯ (Maybe Thread+)) → IRed

Returns a passable thread local collection recipe that reads from a given readable byte channel rch and forwards exceptions to the resource when failed.

register-factory!

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (register-factory! scheme resource-factory)

Type signature:
  • (String+ ⨯ IAcquirableFactory) → nil

Registers new resource factory under scheme and returns nil.