Created
October 10, 2021 17:39
-
-
Save deanwampler/ff653b10fa398642f42fc6cd606dd093 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polyglotprogramming.messaging.v2 | |
import polyglotprogramming.messaging.* | |
import polyglotprogramming.messaging.v2.given | |
object Processor: | |
def apply[IM <: IncomingMessage](message: IM)(using handler: MessageHandler[IM]): OutgoingMessage = | |
handler(message) | |
@main def Messaging() = | |
println(Processor(Start("start"))) | |
println(Processor(DoWork1("dowork1"))) | |
println(Processor(DoWork2("dowork2"))) | |
println(Processor(Stop("stop"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment