commonMain.it.unibo.pulvreakt.dsl.PulverizationDsl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-jvm Show documentation
Show all versions of core-jvm Show documentation
A framework to create a pulverized system
package it.unibo.pulvreakt.dsl
import arrow.core.Either
import arrow.core.NonEmptyList
import it.unibo.pulvreakt.dsl.errors.ConfigurationError
import it.unibo.pulvreakt.dsl.model.PulvreaktConfiguration
/**
* Entrypoint for the pulverization DSL used to configure the pulverization system.
*
* ```kotlin
* val configurationResult = pulverization {
* val device by logicDevice {
* withBehaviour() requires setOf(embeddedDevice, highCpu)
* withSensors() requires embeddedDevice
* withCommunication() requires setOf(embeddedDevice, highCpu)
* }
* deployment(infrastructure, MqttProtocol()) {
* device(device) {
* DeviceBehaviour() startsOn server
* DeviceSensors() startsOn smartphone
* DeviceCommunication() startsOn smartphone
* }
* }
* }
* ```
*/
fun pulverization(config: PulverizationScope.() -> Unit): Either, PulvreaktConfiguration> =
PulverizationScope().apply(config).generate()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy