Skip to content

Typed callbacks

Choose a tag to compare

@andycate andycate released this 07 Mar 04:10
· 14 commits to master since this release
10ed8ef

This update changes the callbacks so that the value can be any type. Also, the callback IDs are now Longs. Finally, some minor concurrency errors are addressed.

Example usage of typed callbacks:

Dashboard.addInlineListener("SOME_STRING") {
    key: String, value: String? ->
    println("$key : $value")
}

Dashboard.addInlineListener("SOME_DOUBLE") {
    key: String, value: Double? ->
    println("$key : $value")
}

Dashboard.addConcurrentListener("SOME_INT") {
    key: String, value: Int? ->
    println("$key : $value")
}

Dashboard.runIfUpdate("SOME_BOOLEAN") {
    key: String, value: Boolean? ->
    println("$key : $value")
}

Dashboard.addInlineListener("SOME_VARIABLE") {
    key: String, value: Any? ->
    println("$key : $value")
}