restarter v0.1.0 Restarter

Acts as a back stop. Starts a service (with the supplied module, function, and args). The function is expected to return {:ok, pid}.

Should the service exit, then it is restarted after an interval. There is also the opportunity to delay the start by a period of time.

Summary

Functions

Start this Restarter, and also start the child. Arguments:

  • {module, function, arg} - the child function to start. The function should return {:ok, pid}.
  • retry_interval - on destruction of the child, the number of milliseconds to wait before restarting
  • restarter_otp_opts - OTP options for this Genserver, such as the name. Defaults to []
  • start_delay - the number of milliseconds to wait before first starting the child. Defaults to 0

Functions

start_link(arg, retry_interval, restarter_otp_opts \\ [], start_delay \\ 0)

Start this Restarter, and also start the child. Arguments:

  • {module, function, arg} - the child function to start. The function should return {:ok, pid}.
  • retry_interval - on destruction of the child, the number of milliseconds to wait before restarting
  • restarter_otp_opts - OTP options for this Genserver, such as the name. Defaults to []
  • start_delay - the number of milliseconds to wait before first starting the child. Defaults to 0.