Table of Contents

SetWaitObservers Method

Registers hooks invoked on entry to and on return from WaitForShutdown.

Remarks

Plumbing for Sparkle.Host, not for application code. The call to WaitForShutdown is, by definition, the boundary between starting and running: everything before it is startup, and reaching it means the application is up. That is the instant a Windows service has to report SERVICE_RUNNING to the SCM, and the return is the instant it has to report SERVICE_STOP_PENDING. Exposing the boundary here is what keeps the service contract out of application code.

One set of observers per process; registering again replaces the previous one. Pass nil to unregister. Observers run on the thread that called WaitForShutdown, so they must be short and thread safe -- several hosted blocks may reach the boundary at once.

Syntax

Unit: Sparkle.Host.Shutdown

procedure SetWaitObservers(const ABeforeWait: TShutdownObserver; const AAfterWait: TShutdownObserver);

Parameters

<-> Parameter Type Description
const ABeforeWait TShutdownObserver
const AAfterWait TShutdownObserver