Commit Detail
Commit 026eede
Change ctx.facets.get() to take a callback for start info. Previously, the caller of `facets.get()` would always provide the actor class and (optionally) `id`. If the facet was already running, these values would be compared against the running copy, and the facet would be reset if they didn't match. This proves to be a bit problematic: * Comparing ActorClass objects for equality proves to be more difficult than expected. With dynamic worker loading, the actor class may have dynamically-specified `props`, and comparing `props` for equality is not really possible since it's an arbitrary value. We could say that if you call `dynamicWorker.getActorClass()` multiple times, even with the same inputs, the returned classes are considered "different", but this would probably lead to facets restarting unexpectedly. * The API is aesthetically inconsistent with dynamic worker loading. With worker loaders, you call `loader.get(name, callback)`, where the callback returns the worker code. The callback is not called if the worker is already running. For consistency, facets should work the same way. So, this changes the facets API to now expect a callback as the second parameter to `get()`. The callback is not called if the facet is already running. If you want to change the class or ID, you'll have to abort() the existing facet first.
Files changed
8 files changed~8 modified