sl4jx-kotlin

Provides a Kotlin Flow-based client for consuming data from a Caplin Liberator, wrapping the StreamLink and KeyMaster SDKs.

See also

Samples

// Build a factory for a Liberator, signing KeyMaster tokens with the given private key.
val factory =
    StreamLinkConnectionFactory(
        liberator = "rttp://liberator.example.com:8080",
        keymasterKey = keymasterKey,
    )

// Connect as a user and wait until the session is established.
factory.connect("admin").use { connection ->
  connection.connect()
  connection.awaitConnected()

  // Subscribe to a record subject, keeping only updates and printing each field map.
  connection.getSubject(Subject("SYSTEM", "INFO")).filterIsUpdate().collect { fields ->
    println(fields)
  }
}

Packages

Link copied to clipboard