org.jetlinks.rule.engine.defaults.AbstractTaskExecutor Maven / Gradle / Ivy
The newest version!
package org.jetlinks.rule.engine.defaults;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.context.Context;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.jetlinks.core.trace.FluxTracer;
import org.jetlinks.core.trace.MonoTracer;
import org.jetlinks.rule.engine.api.RuleData;
import org.jetlinks.rule.engine.api.task.ExecutableTaskExecutor;
import org.jetlinks.rule.engine.api.task.ExecutionContext;
import org.jetlinks.rule.engine.api.task.Task;
import reactor.core.Disposable;
import reactor.core.publisher.Mono;
import java.util.function.BiConsumer;
@Slf4j
public abstract class AbstractTaskExecutor implements ExecutableTaskExecutor {
protected final static AttributeKey executor_name = AttributeKey.stringKey("name");
@Getter
protected ExecutionContext context;
@Getter
protected volatile Task.State state = Task.State.shutdown;
protected volatile Disposable disposable;
private MonoTracer