Ask or search…
K
Links
🌐

PerigeeApplication

Application initialization

Both application starting points are nearly identical. The full callback has an IPC token and the initialize callback. Both are described in Hello Perigee.
Application(string appName, string IPCCancelToken, Action<IConfiguration> initialize, Action<ThreadRegistry> taskConfiguration, CancellationTokenSource cancelSource = null, Task HostTask = null, string[] CommandLineArguments = null)
ApplicationNoInit(string appName, Action<ThreadRegistry> taskConfiguration, CancellationTokenSource cancelSource = null, Task HostTask = null, string[] CommandLineArguments = null)
You may also run the ApplicationNoInit as an async method as well:
PerigeeApplication.ApplicationNoInit("async", async (c) => {
await Task.Delay(1000);
});

Host Statistics

To get information about the host it's running on, there is a single method:
GetHostStatistics()
The response class, HostStatistics contains properties for the machine it's running on including machine name, drive info, cpu time and running directory.

Exit event

To get an exit callback, use the helper method supplied.
After return is executed and the domain/service is about to unload, OnExit has a few seconds to perform any last tasks, like persisting data.
static void Main(string[] args)
{
PerigeeApplication.OnExit(() => {
Console.WriteLine("Exiting");
});
return;
}