Skip to content

Kotlin coroutine capable Finite-State Machine (multiplatform)

License

Notifications You must be signed in to change notification settings

anyopensource/comachine

 
 

Repository files navigation

maintenance-status

Comachine

Features

  • Kotlin corutines. Event handlers can launch coroutines for collecting external events of performing side effects.
  • Structured concurrency. Each states is launched in its own coroutine scope, called state scope. Coroutines running in a state scope will be properly cancelled on each state transition.
  • Suspendable event handlers. Four built-in suspendable event handler types can simplify handling of events.
  • Decomposition by feature. State machine can delegate declaration and handling of events to independent features.
  • State extras. Fearures can store objects in the current state even if they are not a part of the state type.

Examples

  1. Simple state machine
  2. Delegation and code decomposition

Binaries

// in project build file
allprojects {
    repositories {
        maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
    }
}

// in module build file
dependencies {
    implementation 'de.halfbit:comachine-jvm:1.0-SNAPSHOT'
}

About

Kotlin coroutine capable Finite-State Machine (multiplatform)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%