Gringotts: A complete payment library for Elixir and Phoenix Framework

Hi @pkrawat1 and team, I would like to reinforce the point above.

Using a GenServer when you don’t need one is an anti-pattern and it will actually have severe applications on the system performance, as you put all operations besides a single process which will become a bottleneck. We cover this in detail in Adopting Elixir and there is a thread about this particular topic in the forum.

Even if you may end-up using the worker for configuration, I would ask you to revisit that, because it should not be the place of libraries to impose a stateful configuration mechanism. Simply ask the users to pass the configuration every time the gateway is called. If the users of your library need to store this configuration somewhere, they can easily do so by using an Agent, application config, GenServer, etc.

11 Likes