Make this work
This commit is contained in:
parent
cdd1286365
commit
dec45b6050
@ -2,7 +2,7 @@ plugins {
|
||||
id("ru.mipt.npm.gradle.project")
|
||||
}
|
||||
|
||||
val dataforgeVersion: String by extra("0.5.2")
|
||||
val dataforgeVersion: String by extra("0.5.1")
|
||||
val ktorVersion: String by extra(ru.mipt.npm.gradle.KScienceVersions.ktorVersion)
|
||||
val rsocketVersion by extra("0.13.1")
|
||||
|
||||
|
@ -22,7 +22,7 @@ import space.kscience.dataforge.meta.string
|
||||
import space.kscience.dataforge.names.Name
|
||||
|
||||
private const val DEFAULT_XODUS_STORE_PATH = ".storage"
|
||||
private val XODUS_STORE_PROPERTY = Name.of("xodus", "entityStorePath")
|
||||
public val XODUS_STORE_PROPERTY: Name = Name.of("xodus", "entityStorePath")
|
||||
|
||||
private fun Context.getPersistentEntityStore(meta: Meta = Meta.EMPTY): PersistentEntityStore {
|
||||
val storePath = meta[XODUS_STORE_PROPERTY]?.string
|
||||
@ -41,7 +41,7 @@ public fun DeviceManager.storeMessagesInXodus(
|
||||
factory: Factory<PersistentEntityStore> = defaultPersistentStoreFactory,
|
||||
filterCondition: suspend (DeviceMessage) -> Boolean = { true },
|
||||
): Job {
|
||||
val entityStore = factory(Meta.EMPTY, context)
|
||||
val entityStore = factory(meta, context)
|
||||
logger.debug { "Device entity store opened" }
|
||||
|
||||
return hubMessageFlow(context).filter(filterCondition).onEach { message ->
|
||||
@ -76,7 +76,7 @@ public fun DeviceManager.storeMessagesInXodus(
|
||||
|
||||
internal fun Flow<GenericMagixMessage>.storeInXodus(
|
||||
entityStore: PersistentEntityStore,
|
||||
flowFilter: (GenericMagixMessage) -> Boolean = { true },
|
||||
flowFilter: suspend (GenericMagixMessage) -> Boolean = { true },
|
||||
) {
|
||||
filter(flowFilter).onEach { message ->
|
||||
entityStore.encodeToEntity(message, "MagixMessage")
|
||||
@ -88,7 +88,7 @@ public fun Application.storeInXodus(
|
||||
flow: MutableSharedFlow<GenericMagixMessage>,
|
||||
meta: Meta = Meta.EMPTY,
|
||||
factory: Factory<PersistentEntityStore> = defaultPersistentStoreFactory,
|
||||
flowFilter: (GenericMagixMessage) -> Boolean = { true },
|
||||
flowFilter: suspend (GenericMagixMessage) -> Boolean = { true },
|
||||
) {
|
||||
val entityStore = factory(meta)
|
||||
|
||||
|
@ -15,6 +15,7 @@ import ru.mipt.npm.controls.controllers.install
|
||||
import ru.mipt.npm.controls.demo.car.IVirtualCar.Companion.acceleration
|
||||
import ru.mipt.npm.controls.mongo.MongoClientFactory
|
||||
import ru.mipt.npm.controls.mongo.connectMongo
|
||||
import ru.mipt.npm.controls.xodus.XODUS_STORE_PROPERTY
|
||||
import ru.mipt.npm.controls.xodus.storeInXodus
|
||||
import ru.mipt.npm.controls.xodus.storeMessagesInXodus
|
||||
import ru.mipt.npm.magix.api.MagixEndpoint
|
||||
@ -55,9 +56,7 @@ class VirtualCarController : Controller(), ContextAware {
|
||||
//starting magix event loop and connect it to entity store
|
||||
magixServer = startMagixServer(enableRawRSocket = true, enableZmq = true) { flow ->
|
||||
storeInXodus( flow, Meta {
|
||||
"xodusConfig" put {
|
||||
"entityStorePath" put VirtualCarControllerConfig.magixEntityStorePath.toString()
|
||||
}
|
||||
XODUS_STORE_PROPERTY put VirtualCarControllerConfig.magixEntityStorePath.toString()
|
||||
})
|
||||
}
|
||||
magixVirtualCar = deviceManager.install("magix-virtual-car", MagixVirtualCar)
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -5,7 +5,7 @@ enableFeaturePreview("VERSION_CATALOGS")
|
||||
|
||||
pluginManagement {
|
||||
|
||||
val toolsVersion = "0.10.7"
|
||||
val toolsVersion = "0.10.5"
|
||||
|
||||
repositories {
|
||||
maven("https://repo.kotlin.link")
|
||||
@ -29,7 +29,7 @@ dependencyResolutionManagement {
|
||||
|
||||
versionCatalogs {
|
||||
create("npm") {
|
||||
from("ru.mipt.npm:version-catalog:0.10.7")
|
||||
from("ru.mipt.npm:version-catalog:0.10.5")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user