Closed aliwassouf closed 3 years ago
Hey @aliwassouf
Thanks for reporting this and sorry for the late response. Here is how you configure PipelinR in Kotlin:
class Ping(val host: String) : Command<String>
class Pong : Handler<Ping, String>{
override fun handle(command: Ping): String {
return "Pong from ${command.host}"
}
}
val handlers = CommandHandlers {
Stream.of(Pong())
}
val pipeline = Pipelinr().with(handlers)
Did it solve your problem?
@sizovs Thanks My friend @lucasls suggested this solution as well. And yes it solved my problem Thanks to you both.
Great! I am closing the issue then.
I'm not yet very familiarized with PipelinR, but I would assume at some of these methods could be extended with Kotlin Extension Functions in order to provide a more Kotlin idiomatic API. Perhaps @aliwassouf and I could try creating those on demand, and depending on our results, contribute back to the project?
@lucasls @aliwassouf if it will make PipelinR more usable in Kotlin, why not giving it a try? I am curious to see what you folks come up with.
How can I adapt the Bean Configuration
in a SpringBoot
project with Kotlin?
How can I adapt the
Bean Configuration
in aSpringBoot
project with Kotlin?
Hei @gustavodaquino. Because the question is not related to this thread, could you please create a separate issue for it, and provide a specific example?
I am following the example of the readme file you guys have (Ping command, Pong handler) but I am using Kotlin.
I have the following code
Now when trying this code
It doesn't compile I get this error: