IOSystem

class IOSystem

This aggregates socket and file I/O information and behavior specific to an AvailRuntime.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
class BufferKey(fileHandle: IOSystem.FileHandle, startPosition: Long)

A BufferKey identifies a file buffer in the cache.

Link copied to clipboard
object Companion
Link copied to clipboard
class FileHandle(val filename: A_String, val alignment: Int, val canRead: Boolean, val canWrite: Boolean, val channel: AsynchronousFileChannel)

A FileHandle is an abstraction which wraps an AsynchronousFileChannel with some additional information like filename and buffer alignment. It gets stuffed in a pojo in a property of the atom that serves as Avail's most basic view of a file handle. Sockets use a substantially similar technique.

Properties

Link copied to clipboard

The thread pool executor for asynchronous file operations performed on behalf of this Avail runtime.

Functions

Link copied to clipboard
fun destroy()

Destroy all data structures used by this AvailRuntime. Also disassociate it from the current Thread's local storage.

Link copied to clipboard

Discard the container responsible for the buffer indicated by the supplied key.

Link copied to clipboard

Schedule the specified task for eventual execution by the thread pool executor for asynchronous file operations. The implementation is free to run the task immediately or delay its execution arbitrarily. The task will not execute on an Avail thread.

Link copied to clipboard

Answer the container responsible for the buffer indicated by the supplied key.

Link copied to clipboard
fun openFile(path: Path, options: Set<OpenOption>, vararg attributes: FileAttribute<*>): AsynchronousFileChannel

Open an asynchronous file channel for the specified path.

Link copied to clipboard
fun openFileWithAvailThread(path: Path, runtime: AvailRuntime, options: Set<OpenOption>, vararg attributes: FileAttribute<*>): AsynchronousFileChannel

Open an asynchronous file channel for the specified path.

Link copied to clipboard