Suggestions to enhance README
andrewhao opened this issue · comments
Hi there,
Thank you so much for creating this library! I'm excited to jump in.
As a relative newcomer to Elixir, I have a couple of observations about library setup in my app that tripped me up. Things that should be obvious to the longtime Elixir programmer are not as intuitive to me - adding some of these pointers might help other folks like me!
-
It would be helpful to include a snippet in your installation section about adding
:event_bus
as an application entry in theMixfile.application
section inmix.exs
. -
You may also want to be explicit in your documentation that any
Listener
modules need to be implemented asGenServer
s, and should be placed under supervision.
Let me know if you'd prefer that I take a swag at this in the README and open a PR.
Thanks!
Hi @andrewhao,
Feel free to create a PR for readme update for the first one I will be happy to merge. For the second one(Listener implementation as GenServer) is optional, it depends on how the developer want to consumes the EventBus events
@mustafaturan - Got it. I'll take a shot at updating the README.
For the second one(Listener implementation as GenServer) is optional, it depends on how the developer want to consumes the EventBus events
Tell me more about that - what are other ways of subscribing to events?
Any module has process/1
can be a listener like below:
defmodule Example do
def process({topic, event_id}) do
# do sth
:ok
end
end
@andrewhao - Feel free to query anything you need to know and PR most welcome. Thanks for the improvement request...
Oh - I should also note I made a shout-out to your library in a recent Elixir talk I gave - https://confreaks.tv/videos/empexla2018-building-beautiful-systems-with-phoenix-contexts-and-domain-driven-design. Thanks!
Wow, that's great talk topic! I couldn't have chance to watch to yet, but it's on my top of the WL now. I am honored, thanks for mentioning the library!