poga / actix-lua

Safe Lua Scripting Environment for Actix
MIT License
121 stars 13 forks source link

Allow registering LuaActor to actix register #12

Open poga opened 5 years ago

poga commented 5 years ago

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 commented 5 years ago

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

poga commented 5 years ago

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 commented 5 years ago

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