A simple and lightweight Kotlin multiplatform framework for system pulverization.
📘 Documentation available here
implementation("it.unibo.pulvreakt:core:<version>")
implementation("it.unibo.pulvreakt:runtime:<version>")
// Specific protocols based on the communicator you want to use
implementation("it.unibo.pulvreakt:rabbitmq-communicator:<version>")
implementation("it.unibo.pulvreakt:mqtt-communicator:<version>")
val embeddedDevice by Capability
val highCpu by Capability
val smartphone = Host("smartphone", embeddedDevice)
val server = Host("server", highCpu)
val infrastructure = nonEmptySetOf(smartphone, server)
val configResult = pulverization {
val device by logicDevice {
withBehaviour<DeviceBehaviour>() requires setOf(embeddedDevice, highCpu)
withSensors<DeviceSensors>() requires embeddedDevice
withCommunication<DeviceCommunication>() requires setOf(embeddedDevice, highCpu)
}
deployment(infrastructure, MqttProtocol()) {
device(device) {
DeviceBehaviour() startsOn server
DeviceSensors() startsOn smartphone
DeviceCommunication() startsOn smartphone
}
}
}
// On the server `main`
val runtimeResult = either {
val config = configResult.bind()
val runtime = PulvreaktRuntime(config, "device", 1, server).bind()
runtime.start().bind()
}
when (runtimeResult) {
is Either.Left -> println("Error: ${runtimeResult.value}")
is Either.Right -> println("Success!")
}
core |
runtime |
rabbitmq-communicator |
|
---|---|---|---|
JVM | ✔️ | ✔️ | ✔️ |
JS | ✔️ | ✔️ | ❌ |
Native* | ✔️ | ✔️ | ❌ |
* The current native supported platforms
are: linux X64
, mingw X64
, macos X64
, macos ARM
, iOS
, watchOS
, tvOS
.
⚠️ Due to a limitation inkotlinx-coroutine
thelinux ARM64
,linux Hfp 32
andmingw X86
platforms are currently not supported.