I have an example of genstage application, and in its consumers I need to use a connection with redis. And I do not understand how I need to pass this connection to handle_events.
If I write:
defp connection do
{:ok, conn} = Redix.start_link(host: "0.0.0.0", port: 6379)
conn
end
Then every time the connection is called inside the handle_events function, it will create a new connection.
how can I solve this problem?