This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.github.benmanes.caffeine.cache.Caffeine | |
import com.github.benmanes.caffeine.cache.Ticker | |
import io.kotest.matchers.shouldBe | |
import org.junit.jupiter.api.Test | |
import java.util.concurrent.ConcurrentHashMap | |
import java.util.concurrent.atomic.AtomicLong | |
import kotlin.time.Duration | |
import kotlin.time.Duration.Companion.seconds | |
import kotlin.time.toJavaDuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns datomic-cdc.core | |
"proof-of-concept that shows how setup change-data-capture for datomic" | |
(:require [datomic.api :as d])) | |
(def processed-t- (atom nil)) | |
(defn start-cdc-thread | |
"starts a new thread to processes all past transactions starting at start-t, then continues processing incoming transactions, using the provided `change-handler` | |
`change-handler` must be a function that takes a single map argument with |
OlderNewer