All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.it.unibo.pulvreakt.dsl.PulverizationDsl.kt Maven / Gradle / Ivy

There is a newer version: 0.10.0
Show newest version
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