actix-lua icon indicating copy to clipboard operation
actix-lua copied to clipboard

Allow registering LuaActor to actix register

Open poga opened this issue 7 years ago • 3 comments

Is your feature request related to a problem? Please describe. Currently, you can't register LuaActor to System or Arbiter since it does not implement SystemService. In order to implement SystemService, LuaActor must impl Default.

The problem is, how do we implement Default for LuaActor? I think the reason actix requires Default for services is that it need to restart them when crashed?

Describe the solution you'd like Figure out how to implement Default for LuaActor. Then implement SystemService, ArbiterService, and Supervised for it.

Describe alternatives you've considered Not sure, need to understand more detail on actix's registry.

poga avatar Sep 18 '18 13:09 poga

https://github.com/Chris-Ricketts/actix-broker might be a potential solution

poga avatar Dec 14 '18 15:12 poga

Also, only one actor per type can be registered to the registry, since LuaActor is a concrete type, we need to work around that.

poga avatar Dec 14 '18 15:12 poga

Actix 0.7.10 provides WeakAddr<A> for weak referencing an actor, which can be used to provide custom registry.

poga avatar Jan 19 '19 03:01 poga