Merge remote-tracking branch 'origin/victorsam/finish-hostory-access' into victorsam/finish-hostory-access

# Conflicts:
#	controls-mongo/build.gradle.kts
#	controls-mongo/src/main/kotlin/ru/mipt/npm/controls/mongo/connections.kt
#	controls-xodus/src/main/kotlin/ru/mipt/npm/controls/xodus/connections.kt
#	controls-xodus/src/main/kotlin/ru/mipt/npm/controls/xodus/util/queries.kt
#	demo/car/src/main/kotlin/ru/mipt/npm/controls/demo/car/VirtualCarController.kt
This commit is contained in:
Atos1337 2022-01-15 16:01:50 +03:00
commit 23e821d2c2

26
controls-xodus/README.md Normal file
View File

@ -0,0 +1,26 @@
# Description
This module allows you to store [DeviceMessages](/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/api/DeviceMessage.kt)
from certain [DeviceManager](/controls-core/src/commonMain/kotlin/ru/mipt/npm/controls/controllers/DeviceManager.kt)
or [MagixMessages](magix/magix-api/src/commonMain/kotlin/ru/mipt/npm/magix/api/MagixMessage.kt)
from [magix server](/magix/magix-server/src/main/kotlin/ru/mipt/npm/magix/server/server.kt)
in [xodus database](https://github.com/JetBrains/xodus).
# Usage
All usage examples can be found in [VirtualCarController](/demo/car/src/main/kotlin/ru/mipt/npm/controls/demo/car/VirtualCarController.kt).
## Storage from Device Manager
Just call connectMongo. For more details, you can see comments in [source code](/controls-xodus/src/main/kotlin/ru/mipt/npm/controls/xodus/connections.kt)
## Storage from Magix Server
Just pass such lambda as parameter to startMagixServer:
```kotlin
{ flow ->
// some code
storeInXodus(flow)
// some code
}
```
For more details, you can see comments in [source code](/controls-xodus/src/main/kotlin/ru/mipt/npm/controls/xodus/connections.kt)