yass2

Small library enabling efficient asynchronous peer-to-peer communication with type-safe contracts. Features include unidirectional remoting, Ktor transport adaptors, code generation, and extendable binary serialization.

JVMKotlin/NativeWasmJS
GitHub stars26
Authorssoftappeal
Open issues0
LicenseBSD 3-Clause "New" or "Revised" License
Creation dateover 6 years ago

Last activity4 days ago
Latest release27.0.0 (3 months ago)

yass2 (Yet Another Service Solution)

  • yass2 is
    • a small Kotlin Multiplatform library
    • for efficient asynchronous/non-blocking Coroutines based peer-to-peer communication
    • enforcing type-safe contracts with interfaces and data transfer objects
                         contract library
                       +-----------------------------------------+
                       | // contract definition                  |
                       | interface Calculator {                  |
                       |   suspend fun add(a: Int, b: Int): Int  |
                       | }                                       |
                       +-----------------------------------------+

  client process                             server process
+----------------------------------+       +----------------------------------------------+
| // contract usage                |       | // contract implementation                   |
| val calculator: Calculator = ... |       | class CalculatorImpl : Calculator {          |
| println(calculator.add(1, 2))    |       |   override suspend fun add(a: Int, b: Int) = |
|                                  |       |     a + b                                    |
|                                  |       | }                                            |
|..................................|       |..............................................|
|         contract library         |       |              contract library                |
|..................................|       |..............................................|
|          yass2 library           |       |               yass2 library                  |
|..................................|       |..............................................|
|        transport library         | <---> |             transport library                |
+----------------------------------+       +----------------------------------------------+
  • provides unidirectional and session-based bidirectional remoting

  • provides Ktor transport adaptors for Http, WebSocket and Socket

  • generates code (works on any platform and is fast) either with KSP or with reflection

    • fast, compact and extendable binary serializer for high throughput and low latency
    • extendable string-based serializers: TextSerializer, JsonSerializer and KotlinSerializer (serializes Kotlin source code)
    • interceptor (around advice, aspect-oriented programming)
  • yass2 has multiple modules with the following dependencies

yass2-core <-- yass2-generate
     ^
     |
yass2-coroutines --> kotlinx-coroutines-core
     ^
     |
yass2-ktor --> Ktor
JVMKotlin/NativeWasmJS
GitHub stars26
Authorssoftappeal
Open issues0
LicenseBSD 3-Clause "New" or "Revised" License
Creation dateover 6 years ago

Last activity4 days ago
Latest release27.0.0 (3 months ago)

yass2 (Yet Another Service Solution)

  • yass2 is
    • a small Kotlin Multiplatform library
    • for efficient asynchronous/non-blocking Coroutines based peer-to-peer communication
    • enforcing type-safe contracts with interfaces and data transfer objects
                         contract library
                       +-----------------------------------------+
                       | // contract definition                  |
                       | interface Calculator {                  |
                       |   suspend fun add(a: Int, b: Int): Int  |
                       | }                                       |
                       +-----------------------------------------+

  client process                             server process
+----------------------------------+       +----------------------------------------------+
| // contract usage                |       | // contract implementation                   |
| val calculator: Calculator = ... |       | class CalculatorImpl : Calculator {          |
| println(calculator.add(1, 2))    |       |   override suspend fun add(a: Int, b: Int) = |
|                                  |       |     a + b                                    |
|                                  |       | }                                            |
|..................................|       |..............................................|
|         contract library         |       |              contract library                |
|..................................|       |..............................................|
|          yass2 library           |       |               yass2 library                  |
|..................................|       |..............................................|
|        transport library         | <---> |             transport library                |
+----------------------------------+       +----------------------------------------------+
  • provides unidirectional and session-based bidirectional remoting

  • provides Ktor transport adaptors for Http, WebSocket and Socket

  • generates code (works on any platform and is fast) either with KSP or with reflection

    • fast, compact and extendable binary serializer for high throughput and low latency
    • extendable string-based serializers: TextSerializer, JsonSerializer and KotlinSerializer (serializes Kotlin source code)
    • interceptor (around advice, aspect-oriented programming)
  • yass2 has multiple modules with the following dependencies

yass2-core <-- yass2-generate
     ^
     |
yass2-coroutines --> kotlinx-coroutines-core
     ^
     |
yass2-ktor --> Ktor