grav
grav copied to clipboard
Multiple OnType message handlers
It would be nice to add more complex Pod type that can handle multiple message types. Pod would be like Actor
Absolutely! #37 is designed to help with that :)
Oh, I see. But we also need guarantees that one pod group can handle one message at a time. Now all pods are independent and handle messages concurrently. We can add a message handling strategy to PodGroup (serial, concurrently, etc.) I want to use it like
func mkPodGroup() *PodGroup {
var state State
pods := g.PodGroup()
pods.New().On(...) // state is used here
pods.New().OnType(...) // state is used here
return pods
}
It looks a bit hacky but it's a good start for stateful handling :) Grav can be good alternative to Vertx in Go world.