ScalangScala 的封裝
Scalang 是一個(gè) Scala 的封裝,可以輕松的編寫服務(wù)來跟 Erlang 接口。
示例代碼:
class MyProcess(ctx : ProcessContext) extends Process(ctx) {
override def onMessage(msg : Any) {
log.info("received %s", msg)
}
}
val pid = node.spawn[MyProcess]("my_process")
//send to the pid
node.send(pid, "hey there")
//send to the regname
node.send("my_process", "you wanna party?")
評論
圖片
表情
