Package-level declarations

Types

Link copied to clipboard
typealias ByteArrayFlow = Flow<ByteArray>
Link copied to clipboard
interface Concurrent<R, W : R>
Link copied to clipboard
class ConcurrentImpl<R, W : R>(constructor: () -> W) : Concurrent<R, W>
Link copied to clipboard
Link copied to clipboard
typealias ConcurrentMap<K, V> = Concurrent<Map<K, V>, MutableMap<K, V>>
Link copied to clipboard
Link copied to clipboard
open class KeyedMutex<K : Any>
Link copied to clipboard
data class RetryFlowDelayConfig(val scheduleBase: Duration = 100.milliseconds, val scheduleFactor: Double = 2.0, val scheduleLimit: Duration = 5.minutes, val scheduleJitter: ClosedRange<Double> = 0.9..1.1)
Link copied to clipboard
annotation class TrixnityPrivateApi

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun byteArrayFlowFromInputStream(coroutineContext: CoroutineContext = ioContext, inputStreamFactory: suspend () -> InputStream): ByteArrayFlow
Link copied to clipboard
fun byteArrayFlowFromReadableStream(streamFactory: suspend () -> ReadableStream<Uint8Array<ArrayBuffer>>): ByteArrayFlow
Link copied to clipboard
fun byteArrayFlowFromSource(coroutineContext: CoroutineContext = ioContext, sourceFactory: suspend () -> Source): Flow<ByteArray>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <R, W : R> concurrentOf(constructor: () -> W): Concurrent<R, W>
Link copied to clipboard
Link copied to clipboard
fun Random.nextString(length: Int, alphabet: List<Char> = defaultAlphabet): String

Returns a string using an alphabet between a-z, A-Z and 0-9.

Link copied to clipboard
fun FileSystem.readByteArrayFlow(path: Path, coroutineContext: CoroutineContext = ioContext): ByteArrayFlow?
Link copied to clipboard
suspend fun <T> retry(scheduleBase: Duration = RetryFlowDelayConfig.default.scheduleBase, scheduleFactor: Double = RetryFlowDelayConfig.default.scheduleFactor, scheduleLimit: Duration = RetryFlowDelayConfig.default.scheduleLimit, scheduleJitter: ClosedRange<Double> = RetryFlowDelayConfig.default.scheduleJitter, onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend () -> T): T
Link copied to clipboard
fun <T> retryFlow(delayConfig: Flow<RetryFlowDelayConfig> = flowOf(RetryFlowDelayConfig()), onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend FlowCollector<T>.() -> Unit): Flow<T>
fun <T> retryFlow(scheduleBase: Duration = RetryFlowDelayConfig.default.scheduleBase, scheduleFactor: Double = RetryFlowDelayConfig.default.scheduleFactor, scheduleLimit: Duration = RetryFlowDelayConfig.default.scheduleLimit, scheduleJitter: ClosedRange<Double> = RetryFlowDelayConfig.default.scheduleJitter, onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend FlowCollector<T>.() -> Unit): Flow<T>
Link copied to clipboard
suspend fun retryLoop(delayConfig: Flow<RetryFlowDelayConfig> = flowOf(RetryFlowDelayConfig()), onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend () -> Unit)
suspend fun retryLoop(scheduleBase: Duration = RetryFlowDelayConfig.default.scheduleBase, scheduleFactor: Double = RetryFlowDelayConfig.default.scheduleFactor, scheduleLimit: Duration = RetryFlowDelayConfig.default.scheduleLimit, scheduleJitter: ClosedRange<Double> = RetryFlowDelayConfig.default.scheduleJitter, onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend () -> Unit)
Link copied to clipboard

suspend fun ByteArrayFlow.toByteArray(maxSize: Long): ByteArray?

Returns null, when maxSize exceeded.

Link copied to clipboard
fun ByteReadChannel.toByteArrayFlow(): ByteArrayFlow

The returned Flow can only be collected once!

Link copied to clipboard
suspend fun ByteArrayFlow.toByteReadChannel(): ByteReadChannel
Link copied to clipboard
suspend fun <T> Mutex.withReentrantLock(block: suspend () -> T): T
Link copied to clipboard
suspend fun BufferedSink.write(content: ByteArrayFlow, coroutineContext: CoroutineContext = ioContext)
suspend fun FileSystem.write(path: Path, content: ByteArrayFlow, coroutineContext: CoroutineContext = ioContext)
suspend fun OutputStream.write(content: ByteArrayFlow, coroutineContext: CoroutineContext = ioContext)
suspend fun WritableStream<Uint8Array<ArrayBuffer>>.write(content: ByteArrayFlow)
Link copied to clipboard
suspend fun ByteArrayFlow.writeTo(byteWriteChannel: ByteWriteChannel)
suspend fun ByteArrayFlow.writeTo(sink: BufferedSink, coroutineContext: CoroutineContext = ioContext)
suspend fun ByteArrayFlow.writeTo(outputStream: OutputStream, coroutineContext: CoroutineContext = ioContext)
suspend fun ByteArrayFlow.writeTo(writableStream: WritableStream<Uint8Array<ArrayBuffer>>)