Gets a boolean that indicates if the current thread is a background thread.
True, if the current thread is a background thread, otherwise false.
Sitecore may handle requests that are not part of a web request. Such requests are considered background or worker threads. An example is the scheduler which uses the API to perform certain tasks. When the scheduler executes, it does not run as a web request.
A developer may use this flag to take certain actions when the current thread is a background thread.
A background thread is defined by the current Http context is null:
HttpContext.Current == null
Context Class | Sitecore Namespace