interface EventLoop
source · line 13public interface EventLoop
The suspending filesystem, timer, resolver, TCP, UDP, and TTY service installed for a structured coroutine scope. Resources and operations belong to their creating loop.
function createDirectories
source · line 66public suspend fun createDirectories(path: Path, mode: Int = 0x1ff): Unit
Creates missing parent directories with the requested mode, subject to the process umask.
parameter path
source · line 66path: Path
parameter mode
source · line 66mode: Int = 0x1ff
function metadata
source · line 54public suspend fun metadata(path: Path, followLinks: Boolean = true): FileMetadata
Queries filesystem metadata, optionally following symbolic links.
parameter followLinks
source · line 54followLinks: Boolean = true
parameter path
source · line 54path: Path
function openTty
source · line 43public suspend fun openTty(): AsyncTty
Opens an owned asynchronous terminal handle.
function connectTcp
source · line 94public suspend fun connectTcp(host: OsString, port: Int, options: TcpConnectOptions = tcpConnectOptions()): AsyncTcpStream
Connects to an IP endpoint, or resolves and races candidates using the supplied host connection options. The returned stream has independent ownership.
parameter host
source · line 95host: OsString
parameter options
source · line 97options: TcpConnectOptions = tcpConnectOptions()
parameter port
source · line 96port: Int
property executor
source · line 19public val executor: CoroutineExecutor
get: public read-only
Runs a single-use native payload on a worker and waits for completion before releasing its active borrow.
The active owner executor. Access before startup or after its termination is rejected.
function resolve
source · line 33public suspend fun resolve(host: OsString, port: Int, family: AddressFamily? = None): Array<
SocketAddress
>
Resolves the host and port, optionally restricted to one address family.
parameter port
source · line 33port: Int
parameter host
source · line 33host: OsString
parameter family
source · line 33family: AddressFamily? = None
function openDirectory
source · line 77public suspend fun openDirectory(path: Path): AsyncDirectoryEntries
Opens an owned directory enumeration cursor.
parameter path
source · line 77path: Path
function listenTcp
source · line 102public suspend fun listenTcp(address: SocketAddress, backlog: Int = 128, reuseAddress: Boolean = false): AsyncTcpListener
Binds and listens for TCP connections with the requested backlog and address-reuse setting.
parameter address
source · line 103address: SocketAddress
parameter backlog
source · line 104backlog: Int = 128
parameter reuseAddress
source · line 105reuseAddress: Boolean = false
function sleep
source · line 23public suspend fun sleep(duration: Duration): Unit
Suspends for a nonnegative duration and follows current-job cancellation.
parameter duration
source · line 23duration: Duration
function deleteFile
source · line 62public suspend fun deleteFile(path: Path): Unit
Deletes the selected filesystem entry.
parameter path
source · line 62path: Path
function connectTcp
source · line 89public suspend fun connectTcp(address: SocketAddress): AsyncTcpStream
Connects to an IP endpoint, or resolves and races candidates using the supplied host connection options. The returned stream has independent ownership.
parameter address
source · line 89address: SocketAddress
function spawnPty
source · line 45public suspend fun spawnPty(command: Command, columns: Long, rows: Long, searchPath: Boolean = false): AsyncPty
Launches a child on an owned pseudoterminal using cell dimensions.
parameter columns
source · line 47columns: Long
parameter command
source · line 46command: Command
parameter searchPath
source · line 49searchPath: Boolean = false
parameter rows
source · line 48rows: Long
function openFile
source · line 39public suspend fun openFile(path: Path, options: OpenOptions = OpenOptions()): AsyncFile
Opens an owned asynchronous file using explicit access, creation, and truncation options.
parameter options
source · line 39options: OpenOptions = OpenOptions()
parameter path
source · line 39path: Path
function schedule
source · line 29public fun schedule(duration: Duration, completion: (Throwable?) -> Unit): Disposable
Schedules one owner-thread notification without creating a coroutine. None means elapsed; an error reports timer failure. Disposal or current-job cancellation suppresses an unselected notification. The callback does not inherit Context and must not block the owner.
parameter duration
source · line 29duration: Duration
parameter completion
source · line 29completion: (Throwable?) -> Unit
function bindUdp
source · line 81public suspend fun bindUdp(address: SocketAddress, reuseAddress: Boolean = false): AsyncUdpSocket
Binds an owned UDP socket, optionally enabling address reuse.
parameter address
source · line 82address: SocketAddress
parameter reuseAddress
source · line 83reuseAddress: Boolean = false
function createTempFile
source · line 70public suspend fun createTempFile(parent: Path? = None, prefix: String = "scoop-"): TemporaryFile
Creates a unique temporary file and returns both its path and open handle.
parameter prefix
source · line 72prefix: String = "scoop-"
parameter parent
source · line 71parent: Path? = None
function moveFile
source · line 58public suspend fun moveFile(source: Path, destination: Path, replaceExisting: Boolean = false): Unit
Moves a filesystem entry, replacing the destination only when requested.
parameter source
source · line 58source: Path
parameter destination
source · line 58destination: Path
parameter replaceExisting
source · line 58replaceExisting: Boolean = false