类 ContextPropagatingTaskDecorator

java.lang.Object
cn.taketoday.core.task.support.ContextPropagatingTaskDecorator
所有已实现的接口:
Decorator<Runnable>, TaskDecorator

public class ContextPropagatingTaskDecorator extends Object implements TaskDecorator
TaskDecorator that wrap the execution of tasks, assisting with context propagation.

This operation is only useful when the task execution is scheduled on a different thread than the original call stack; this depends on the choice of TaskExecutor. This is particularly useful for restoring a logging context or an observation context for the task execution. Note that this decorator will cause some overhead for task execution and is not recommended for applications that run lots of very small tasks.

从以下版本开始:
4.0 2023/9/3 12:53
作者:
Brian Clozel, Harry Yang
另请参阅:
  • 字段详细资料

    • factory

      private final io.micrometer.context.ContextSnapshotFactory factory
  • 构造器详细资料

    • ContextPropagatingTaskDecorator

      public ContextPropagatingTaskDecorator()
      Create a new decorator that uses a default instance of the ContextSnapshotFactory.
    • ContextPropagatingTaskDecorator

      public ContextPropagatingTaskDecorator(io.micrometer.context.ContextSnapshotFactory factory)
      Create a new decorator using the given ContextSnapshotFactory.
      参数:
      factory - the context snapshot factory to use.
  • 方法详细资料