mirror of
https://github.com/InsanusMokrassar/PsychomatrixBase.git
synced 2026-06-28 14:15:00 +00:00
Compare commits
3 Commits
ae0ea72f55
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 88cd06945c | |||
| 2c5eb625ef | |||
| fda82d4630 |
@@ -0,0 +1,41 @@
|
|||||||
|
package com.github.insanusmokrassar.PsychomatrixBase.domain.interactors
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CeilDescriptionReady
|
||||||
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CeilDescriptionUseCase
|
||||||
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.CeilInfo
|
||||||
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.CeilState
|
||||||
|
import kotlinx.coroutines.*
|
||||||
|
import kotlinx.coroutines.channels.BroadcastChannel
|
||||||
|
import kotlinx.coroutines.channels.ReceiveChannel
|
||||||
|
|
||||||
|
class CeilDescriptionInteractor : CeilDescriptionUseCase {
|
||||||
|
private val scope = CoroutineScope(Dispatchers.Default)
|
||||||
|
private val ceilDescriptionReadyBroadcastChannel = BroadcastChannel<CeilDescriptionReady>(
|
||||||
|
16
|
||||||
|
)
|
||||||
|
private val ceilDescriptionRequestedBroadcastChannel = BroadcastChannel<CeilState>(
|
||||||
|
8
|
||||||
|
)
|
||||||
|
|
||||||
|
override fun openCeilDescriptionReadySubscription(): ReceiveChannel<CeilDescriptionReady> {
|
||||||
|
return ceilDescriptionReadyBroadcastChannel.openSubscription()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun openCeilDescriptionRequestedSubscription(): ReceiveChannel<CeilState> {
|
||||||
|
return ceilDescriptionRequestedBroadcastChannel.openSubscription()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun descriptionReady(ceilState: CeilState, ceilInfo: CeilInfo) {
|
||||||
|
scope.launch {
|
||||||
|
ceilDescriptionReadyBroadcastChannel.send(ceilState to ceilInfo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun requestDescription(ceilState: CeilState) {
|
||||||
|
scope.launch {
|
||||||
|
ceilDescriptionRequestedBroadcastChannel.send(
|
||||||
|
ceilState
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,9 +34,3 @@ dependencies {
|
|||||||
// Use JUnit test framework
|
// Use JUnit test framework
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|
||||||
compileKotlin {
|
|
||||||
kotlinOptions {
|
|
||||||
freeCompilerArgs = [ disableImplicitReflectionSerializerAnnotation ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ kotlin_serialisation_runtime_version=1.2.0
|
|||||||
joda_time_version=2.10.1
|
joda_time_version=2.10.1
|
||||||
ktor_version=1.1.4
|
ktor_version=1.1.4
|
||||||
|
|
||||||
|
android.useAndroidX=true
|
||||||
|
|
||||||
gradle_bintray_plugin_version=1.8.4
|
gradle_bintray_plugin_version=1.8.4
|
||||||
|
|
||||||
disableImplicitReflectionSerializerAnnotation=-Xexperimental=kotlinx.serialization.ImplicitReflectionSerializer
|
disableImplicitReflectionSerializerAnnotation=-Xexperimental=kotlinx.serialization.ImplicitReflectionSerializer
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.5-bin.zip
|
||||||
|
|||||||
Reference in New Issue
Block a user