Postgrex.Notifications.start_link
start_link
, go back to Postgrex.Notifications module for more information.
Specs
start_link(Keyword.t()) :: {:ok, pid()} | {:error, Postgrex.Error.t() | term()}
Start the notification connection process and connect to postgres.
The options that this function accepts are the same as those accepted by
Postgrex.start_link/1
, as well as the extra options :sync_connect
,
:auto_reconnect
, :reconnect_backoff
, and :configure
.
Options
:sync_connect
- controls if the connection should be established on boot or asynchronously right after boot. Defaults totrue
.:auto_reconnect
- automatically attempt to reconnect to the database in event of a disconnection. See the note about async connect and auto-reconnects above. Defaults tofalse
.:reconnect_backoff
- time (in ms) between reconnection attempts whenauto_reconnect
is enabled. Defaults to500
.:idle_interval
- while also accepted onPostgrex.start_link/1
, it has a default of5000ms
inPostgrex.Notifications
(instead of 1000ms).:configure
- A function to run before every connect attempt to dynamically configure the options as a{module, function, args}
, where the current options will prepended toargs
. Defaults tonil
.