Closed DohanKim closed 7 months ago
Super, thank you @DohanKim !
What do you think of putting the Dsl logic into it's own module (dsl.ex or something like that)? This is something I've wanted to do for a while and keep event.ex just for the event struct & casting stuff.
@DohanKim heads up that I just merged some additional changes to master which may break your PR. I think the main thing will be getting the events pid for tests will now work like this:
events_pid = find_worker_pid(destinations_supervisor_pid, DestinationsEventModules)
I moved Event under destinations and renamed the nodule to EventModules.
I agree with putting DSL logic into a separate module. let me try to implement it.
https://github.com/cpursley/walex/pull/36/commits/4a9a19a7318f650a4a0d66da562cc0c0b53de7be
import WalEx.Event.Dsl
such as
use WalEx.Event, name: :test_app
import WalEx.Event.Dsl
I think it's more clear to users than importing the Dsl macro implicitly in WalEx.Event.
it seems that you are not using the word and concept of "DSL" anymore in the README file, so making the macro imported implicitly look more natural. changed the PR accordingly
problem: using DSL like README gives a compilation error (v 3.6.0)
reason: wrong macro definition
the codes in the WalEx.Event is defining macro like below.
this code gives an error.
You intended something like the one below per README.
p.s: Using macro like this is not encouraged https://stackoverflow.com/questions/53065864/define-another-macro-inside-using
it would be better to add test cases for the DSL usage.
thank you for the effort to improve the library. I am gratefully using your library.