You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Hewdig.Robot module masquerades as a pseudo behaviour through macros and injection of code into the user's module. This has couple issues, most notably the robot cannot be started twice - for example with different adapters - to handle traffic from two different networks. This limitation prevents me from using the library in it's current shape.
The Hedwig.Robot should be made a real behaviour with API similar to GenServer or to the custom Connection behaviour. This would make the code more flexible for runtime changes and configuration. Limiting injecting code into user modules should also speed up compilation. It is generally discouraged to inject large amounts of code into user modules.
If you agree this would be beneficial I would be glad to work on this.
The text was updated successfully, but these errors were encountered:
I'd love to see this for 2.0 as well. I just ran into another issue that stems from this, where a race condition exists due to the global name registration being deferred until handle_connect in the Robot behavior. Ideally this would be in start_link but that function is part of the code being injected and can't be overridden. I'd even settle for init but it's also being injected.
Currently the
Hewdig.Robot
module masquerades as a pseudo behaviour through macros and injection of code into the user's module. This has couple issues, most notably the robot cannot be started twice - for example with different adapters - to handle traffic from two different networks. This limitation prevents me from using the library in it's current shape.The
Hedwig.Robot
should be made a real behaviour with API similar toGenServer
or to the customConnection
behaviour. This would make the code more flexible for runtime changes and configuration. Limiting injecting code into user modules should also speed up compilation. It is generally discouraged to inject large amounts of code into user modules.If you agree this would be beneficial I would be glad to work on this.
The text was updated successfully, but these errors were encountered: