Interface ISupervisionHost
- Namespace
- AppHealthMonitor
- Assembly
- AppHealthMonitor.dll
The seam through which a HealthMonitor whose monitoring loop has ended asks to be supervised again, without knowing anything about how the monitoring cycle is run.
public interface ISupervisionHost
Remarks
A monitor that exhausted its restart attempts has stopped watching its application, and an operator asking for that application back is precisely the case the daemon exists to serve. Launching it from the monitor alone would leave a process nothing supervises, so a revival is a two-party transaction: the monitor asks the host to hold a place in the running cycle, and only launches once the host has agreed to take a monitoring task back.
Nothing about what runs crosses this seam. The host is told a name, for logging, and is handed a Task. The process is launched by the monitor from the ProcessStartInfo it built in its own constructor.
Methods
TryReserveRevival(string, out string)
Reserves a place in the running monitoring cycle for a monitor that is about to be revived.
ISupervisionReservation? TryReserveRevival(string monitorName, out string refusal)
Parameters
monitorNamestringThe monitor's name, used only for logging.
refusalstringWhen no reservation could be made, a sentence saying why.
Returns
- ISupervisionReservation
A reservation, or null when supervision cannot be resumed.
Remarks
While a reservation is outstanding the cycle cannot conclude, which is what makes it safe for the caller to launch a process before handing the monitoring task back. The caller must dispose the reservation on every path.