Is Scala's actors similar to Go's coroutines?

后端 未结 5 1939
时光说笑
时光说笑 2020-12-22 15:09

If I wanted to port a Go library that uses Goroutines, would Scala be a good choice because its inbox/akka framework is similar in nature to coroutines?

5条回答
  •  北海茫月
    2020-12-22 15:42

    can we say that in Actor Model, the addressable entity is the Actor, the recipient of message. whereas in Go channels, the addressable entity is the channel, the pipe in which message flows.

    in Go channel, you send message to the channel, and any number of recipients can be listening, and one of them will receive the message.

    in Actor only one actor to whose actor-ref you send the message, will receive the message.

提交回复
热议问题