rogeralsing/Pigeon — pull request #47 by Aaronontheweb (2014-02-21 23:21:06+00:00)
Title: added SupervisorStrategy as an optional Props setting

@rogeralsing I took note of how you lazily instantiated the SupervisorStrategy (since it's probably not needed in 90% of cases) and worked with that in this example.

I wanted a way to be able to generically configure the supervisor strategy of any Actor and thought doing that through Props was the optimal way to do it.

Your lazy instantiation logic is still intact - Props.SupervisorStrategy defaults to null, so even after the ActorCell spawns the Actor it won't have a supervisor strategy in-place until a failure message arrives from a child.

However, if I explicitly specify a supervisory strategy when I'm setting up props, then it will be instantiated during Actor creation.

In order to make this serializable, we should create a Config section for supervisor strategies, similar to what's currently in-place for Routers.

That way, in addition to being network-serializable, all supervisor strategies - whether explicitly set or not, can be instantiated lazily from configuration.

Thoughts?