Spear.Connection.start_link
You're seeing just the function
start_link
, go back to Spear.Connection module for more information.
Specs
start_link(opts :: Keyword.t()) :: {:ok, t()} | GenServer.on_start()
Starts a connection process
This function can be called directly in order to link it to the current
process, but the more common workflow is to start a Spear.Connection
GenServer as a part of a supervision tree.
Examples
E.g. in an application's supervision tree defined in
lib/my_app/application.ex
:
children = [
{Spear.Connection, name: MyConnection, connection_string: "esdb://localhost:2113"}
]
Supervisor.start_link(children, strategy: :one_for_one)