Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 728 Bytes

README.md

File metadata and controls

35 lines (26 loc) · 728 Bytes

Overview

Kotlin/JVM coroutine-based distributed locks.

Like ShedLock but kotlin-first.

Distribution

Available from maven central.

Usage

SQL databases

Configure SQL Provider

First, create lock table (please note that name has to be primary key)

-- PostgreSQL
CREATE TABLE kotlocks(name VARCHAR(64) NOT NULL, lock_until TIMESTAMPTZ NOT NULL,
    locked_at TIMESTAMPTZ NOT NULL, locked_by VARCHAR(255) NOT NULL, PRIMARY KEY (name));

Add dependency

dependencies {
    implementation("io.github.darkxanter:kotlock-sql-exposed:$kotlockVersion")
}

MongoDB

dependencies {
    implementation("io.github.darkxanter:kotlock-mongo-reactive-streams:$kotlockVersion")
}