Skip to content

Instantly share code, notes, and snippets.

View renatoeufe's full-sized avatar
🏠
Working from home

Renato E F renatoeufe

🏠
Working from home
View GitHub Profile
@davidfowl
davidfowl / gist:4015810
Created November 5, 2012 07:33
Detect ASP.NET shutdown
internal class ShutdownDetector : IRegisteredObject, IDisposable
{
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
private Timer _checkAppPoolTimer;
private static readonly TimeSpan _appPoolCheckInterval = TimeSpan.FromSeconds(10);
public CancellationToken Token
{
get { return _cts.Token; }
}