Skip to content

Commit

Permalink
use real domain
Browse files Browse the repository at this point in the history
  • Loading branch information
himadieievsv committed Jan 6, 2024
1 parent c9aaea2 commit e3bad50
Show file tree
Hide file tree
Showing 55 changed files with 148 additions and 148 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ docker-compose up -d

### Extending RedPulsar to use other data stores
Currently, all features are implemented with Redis. However, it is possible to extend RedPulsar to use other distributed data stores like AWS DynamoDB / Casandra / ScyllaDB etc. Even it could be implemented with RDBMS like MySQL or PostgreSQL.
RedPulsar project have an abstraction level for data storage called [Backend](./redpulsar-core/src/main/kotlin/me/himadieiev/redpulsar/core/locks/abstracts/Backend.kt). See package [me.himadieiev.redpulsar.core.locks.abstracts.backends](./redpulsar-core/src/main/kotlin/me/himadieiev/redpulsar/core/locks/abstracts/backends) for details what particular operation should be implemented.
RedPulsar project have an abstraction level for data storage called [Backend](./redpulsar-core/src/main/kotlin/me/himadieiev/redpulsar/core/locks/abstracts/Backend.kt). See package [com.himadieiev.redpulsar.core.locks.abstracts.backends](./redpulsar-core/src/main/kotlin/me/himadieiev/redpulsar/core/locks/abstracts/backends) for details what particular operation should be implemented.
New data storage should use a new module and implement same abstractions as current Redis implementations.

### Contributing
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
}

allprojects {
group = "me.himadieiev"
group = "com.himadieiev"
version = "0.9.1"

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import com.himadieiev.redpulsar.core.locks.abstracts.backends.CountDownLatchBackend
import com.himadieiev.redpulsar.core.locks.api.CallResult
import com.himadieiev.redpulsar.core.locks.api.CountDownLatch
import com.himadieiev.redpulsar.core.locks.excecutors.executeWithRetry
import com.himadieiev.redpulsar.core.locks.excecutors.waitAnyJobs
import com.himadieiev.redpulsar.core.utils.failsafe
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeout
import me.himadieiev.redpulsar.core.locks.abstracts.backends.CountDownLatchBackend
import me.himadieiev.redpulsar.core.locks.api.CallResult
import me.himadieiev.redpulsar.core.locks.api.CountDownLatch
import me.himadieiev.redpulsar.core.locks.excecutors.executeWithRetry
import me.himadieiev.redpulsar.core.locks.excecutors.waitAnyJobs
import me.himadieiev.redpulsar.core.utils.failsafe
import java.time.Duration
import java.util.UUID
import java.util.concurrent.atomic.AtomicInteger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import com.himadieiev.redpulsar.core.locks.abstracts.AbstractMultyInstanceLock
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import me.himadieiev.redpulsar.core.locks.abstracts.AbstractMultyInstanceLock
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import java.time.Duration

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import com.himadieiev.redpulsar.core.locks.abstracts.AbstractMultyInstanceLock
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import me.himadieiev.redpulsar.core.locks.abstracts.AbstractMultyInstanceLock
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import java.time.Duration

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import com.himadieiev.redpulsar.core.locks.abstracts.AbstractLock
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import me.himadieiev.redpulsar.core.locks.abstracts.AbstractLock
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import java.time.Duration

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.himadieiev.redpulsar.core.locks.abstracts
package com.himadieiev.redpulsar.core.locks.abstracts

import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import me.himadieiev.redpulsar.core.locks.api.Lock
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import com.himadieiev.redpulsar.core.locks.api.Lock
import mu.KotlinLogging
import java.time.Duration
import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.himadieiev.redpulsar.core.locks.abstracts
package com.himadieiev.redpulsar.core.locks.abstracts

import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.joinAll
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import java.time.Duration
import java.util.concurrent.atomic.AtomicInteger
import kotlin.coroutines.cancellation.CancellationException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.himadieiev.redpulsar.core.locks.abstracts
package com.himadieiev.redpulsar.core.locks.abstracts

import com.himadieiev.redpulsar.core.utils.failsafe
import kotlinx.coroutines.flow.Flow
import me.himadieiev.redpulsar.core.utils.failsafe
import java.util.NoSuchElementException

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.himadieiev.redpulsar.core.locks.abstracts.backends
package com.himadieiev.redpulsar.core.locks.abstracts.backends

import com.himadieiev.redpulsar.core.locks.abstracts.Backend
import kotlinx.coroutines.flow.Flow
import me.himadieiev.redpulsar.core.locks.abstracts.Backend
import java.time.Duration

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.himadieiev.redpulsar.core.locks.abstracts.backends
package com.himadieiev.redpulsar.core.locks.abstracts.backends

import me.himadieiev.redpulsar.core.locks.abstracts.Backend
import com.himadieiev.redpulsar.core.locks.abstracts.Backend
import java.time.Duration

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.locks.api
package com.himadieiev.redpulsar.core.locks.api

import java.time.Duration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.locks.api
package com.himadieiev.redpulsar.core.locks.api

import java.time.Duration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.locks.excecutors
package com.himadieiev.redpulsar.core.locks.excecutors

import kotlinx.coroutines.Job
import kotlinx.coroutines.joinAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.himadieiev.redpulsar.core.locks.excecutors
package com.himadieiev.redpulsar.core.locks.excecutors

import com.himadieiev.redpulsar.core.locks.abstracts.Backend
import com.himadieiev.redpulsar.core.utils.withRetry
import com.himadieiev.redpulsar.core.utils.withTimeoutInThread
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import me.himadieiev.redpulsar.core.locks.abstracts.Backend
import me.himadieiev.redpulsar.core.utils.withRetry
import me.himadieiev.redpulsar.core.utils.withTimeoutInThread
import java.time.Duration
import java.util.Collections
import kotlin.system.measureTimeMillis
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.utils
package com.himadieiev.redpulsar.core.utils

import mu.KotlinLogging

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.utils
package com.himadieiev.redpulsar.core.utils

import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.utils
package com.himadieiev.redpulsar.core.utils

import mu.KotlinLogging

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import TestTags
import com.himadieiev.redpulsar.core.locks.abstracts.backends.CountDownLatchBackend
import com.himadieiev.redpulsar.core.locks.api.CallResult
import io.mockk.coEvery
import io.mockk.every
import io.mockk.mockk
Expand All @@ -10,8 +12,6 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import me.himadieiev.redpulsar.core.locks.abstracts.backends.CountDownLatchBackend
import me.himadieiev.redpulsar.core.locks.api.CallResult
import org.junit.jupiter.api.Assertions.assertDoesNotThrow
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import TestTags
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package me.himadieiev.redpulsar.core.locks
package com.himadieiev.redpulsar.core.locks

import TestTags
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import org.junit.jupiter.api.Assertions.assertDoesNotThrow
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.himadieiev.redpulsar.core.locks.excecutors
package com.himadieiev.redpulsar.core.locks.excecutors

import TestTags
import com.himadieiev.redpulsar.core.locks.abstracts.Backend
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import me.himadieiev.redpulsar.core.locks.abstracts.Backend
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Tag
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.utils
package com.himadieiev.redpulsar.core.utils

import io.mockk.mockk
import org.junit.jupiter.api.Assertions.assertEquals
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.utils
package com.himadieiev.redpulsar.core.utils

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertTrue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.himadieiev.redpulsar.core.utils
package com.himadieiev.redpulsar.core.utils

import mu.KotlinLogging
import org.junit.jupiter.api.Assertions.assertEquals
Expand Down
4 changes: 2 additions & 2 deletions redpulsar-jedis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Gradle dependency:
```kotlin
implementation("me.himadieiev:redpulsar-core:0.1.1")
implementation("me.himadieiev:redpulsar-jedis:0.1.1")
implementation("com.himadieiev:redpulsar-core:0.1.1")
implementation("com.himadieiev:redpulsar-jedis:0.1.1")
implementation("redis.clients:jedis:5.1.0")
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package me.himadieiev.redpulsar.jedis.locks
package com.himadieiev.redpulsar.jedis.locks

import com.himadieiev.redpulsar.core.locks.ListeningCountDownLatch
import com.himadieiev.redpulsar.core.locks.RedLock
import com.himadieiev.redpulsar.core.locks.Semaphore
import com.himadieiev.redpulsar.core.locks.SimpleLock
import com.himadieiev.redpulsar.jedis.locks.backends.JedisCountDownLatchBackend
import com.himadieiev.redpulsar.jedis.locks.backends.JedisLocksBackend
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import me.himadieiev.redpulsar.core.locks.ListeningCountDownLatch
import me.himadieiev.redpulsar.core.locks.RedLock
import me.himadieiev.redpulsar.core.locks.Semaphore
import me.himadieiev.redpulsar.core.locks.SimpleLock
import me.himadieiev.redpulsar.jedis.locks.backends.JedisCountDownLatchBackend
import me.himadieiev.redpulsar.jedis.locks.backends.JedisLocksBackend
import redis.clients.jedis.UnifiedJedis
import java.time.Duration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.himadieiev.redpulsar.jedis.locks.backends
package com.himadieiev.redpulsar.jedis.locks.backends

import com.himadieiev.redpulsar.core.locks.abstracts.backends.CountDownLatchBackend
import com.himadieiev.redpulsar.core.utils.failsafe
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.launch
import me.himadieiev.redpulsar.core.locks.abstracts.backends.CountDownLatchBackend
import me.himadieiev.redpulsar.core.utils.failsafe
import mu.KotlinLogging
import redis.clients.jedis.JedisPubSub
import redis.clients.jedis.UnifiedJedis
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.himadieiev.redpulsar.jedis.locks.backends
package com.himadieiev.redpulsar.jedis.locks.backends

import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import me.himadieiev.redpulsar.core.utils.failsafe
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import com.himadieiev.redpulsar.core.utils.failsafe
import redis.clients.jedis.UnifiedJedis
import redis.clients.jedis.params.SetParams
import java.time.Duration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package me.himadieiev.redpulsar.jedis.integrationtests
package com.himadieiev.redpulsar.jedis.integrationtests

import TestTags
import com.himadieiev.redpulsar.core.locks.ListeningCountDownLatch
import com.himadieiev.redpulsar.core.locks.api.CallResult
import com.himadieiev.redpulsar.core.locks.api.CountDownLatch
import com.himadieiev.redpulsar.core.utils.withTimeoutInThread
import com.himadieiev.redpulsar.jedis.locks.backends.JedisCountDownLatchBackend
import getInstances
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import me.himadieiev.redpulsar.core.locks.ListeningCountDownLatch
import me.himadieiev.redpulsar.core.locks.api.CallResult
import me.himadieiev.redpulsar.core.locks.api.CountDownLatch
import me.himadieiev.redpulsar.core.utils.withTimeoutInThread
import me.himadieiev.redpulsar.jedis.locks.backends.JedisCountDownLatchBackend
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.himadieiev.redpulsar.jedis.integrationtests
package com.himadieiev.redpulsar.jedis.integrationtests

import TestTags
import com.himadieiev.redpulsar.core.locks.RedLock
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import com.himadieiev.redpulsar.jedis.locks.backends.JedisLocksBackend
import getInstances
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import me.himadieiev.redpulsar.core.locks.RedLock
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import me.himadieiev.redpulsar.jedis.locks.backends.JedisLocksBackend
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.Assertions.assertTrue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.himadieiev.redpulsar.jedis.integrationtests
package com.himadieiev.redpulsar.jedis.integrationtests

import TestTags
import com.himadieiev.redpulsar.core.locks.Semaphore
import com.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import com.himadieiev.redpulsar.jedis.locks.backends.JedisLocksBackend
import getInstances
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import me.himadieiev.redpulsar.core.locks.Semaphore
import me.himadieiev.redpulsar.core.locks.abstracts.backends.LocksBackend
import me.himadieiev.redpulsar.jedis.locks.backends.JedisLocksBackend
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.BeforeEach
Expand Down
Loading

0 comments on commit e3bad50

Please sign in to comment.