SqliteQueueWriteLayer

class SqliteQueueWriteLayer<T>(name: String, serializer: Serializer<T>) : SqliteManager, QueueWriteLayer<T>

Constructors

Link copied to clipboard
fun <T> SqliteQueueWriteLayer(name: String, serializer: Serializer<T>)

Functions

Link copied to clipboard
open suspend fun clear()
Link copied to clipboard
open override fun close()
Link copied to clipboard
fun enableWAL()

Util function for enabling WAL mode. Make sure to create the database first by executing some SQL statement before this.

Link copied to clipboard
open suspend override fun peek(n: Int): List<T>
Link copied to clipboard
open suspend override fun pop(n: Int)
Link copied to clipboard
open suspend override fun push(t: List<T>)
Link copied to clipboard
fun query(block: Connection.() -> Unit)

Get a hold of a Connection to execute queries. If you're going to do any write operations then you should use tx instead.

Link copied to clipboard
open suspend override fun size(): Int
Link copied to clipboard
fun tx(block: Connection.() -> Unit)

Get a Connection within a transaction. This will just commit for you and rollback in a catch block.

Link copied to clipboard
fun vacuum()

Properties

Link copied to clipboard
open override val concurrentPushPop: Boolean = true

Specify whether this write layer is capable of handling pushing and popping concurrently. The queue handler will parallelize the incoming push/pop requests if this can support it. Otherwise, they will be serialized.

Link copied to clipboard
open override val databaseUrl: String

JDBC string to pass into DriverManager.getConnection.