Search Results for

    Show / Hide Table of Contents
    View Source

    Class FireAndForgetRunner

    Default implementation of IFireAndForgetRunner that runs tasks on background threads.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core
    Assembly: Umbraco.Core.dll
    Syntax
    public class FireAndForgetRunner : IFireAndForgetRunner
    Remarks

    This implementation suppresses the execution context flow to prevent AsyncLocal values from leaking to child threads.

    Constructors

    View Source

    FireAndForgetRunner(ILogger<FireAndForgetRunner>)

    Initializes a new instance of the FireAndForgetRunner class.

    Declaration
    public FireAndForgetRunner(ILogger<FireAndForgetRunner> logger)
    Parameters
    Type Name Description
    ILogger<FireAndForgetRunner> logger

    The logger for recording exceptions from background tasks.

    Methods

    View Source

    RunFireAndForget(Func<Task>)

    Runs the specified task in the background without waiting for it to complete.

    Declaration
    public void RunFireAndForget(Func<Task> task)
    Parameters
    Type Name Description
    Func<Task> task

    A function that returns the task to execute.

    Remarks

    The task will be executed on a background thread. Exceptions will be logged but not propagated to the caller.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX