asynkron / protoactor-go

Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
http://proto.actor
Apache License 2.0
5k stars 518 forks source link

Is every actor message Receiver run in they own goroutine ? #1049

Closed calvin2021y closed 4 months ago

calvin2021y commented 4 months ago

I want to do some action like Redis in receive func, is this allowed ?

rogeralsing commented 4 months ago

An actor does not have a dedicated Go-routine, instead we schedule the actor onto a new Go-routine whenever the actor has messages in the mailbox. once it is done, that Go-routine would end.

But it does guarantee that there is at most one Go-routine running per actor. And yes, talking to Redis from an actor is fine