Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion runtime/src/main/java/dev/cel/runtime/async/CelAsyncRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import javax.annotation.concurrent.ThreadSafe;
import dev.cel.common.CelAbstractSyntaxTree;
import dev.cel.runtime.CelEvaluationException;
import dev.cel.runtime.CelRuntimeFactory;
import dev.cel.runtime.UnknownContext;

/**
Expand All @@ -32,11 +33,21 @@
* <li>{@link AsyncProgram} provides an evaluation manager to automate evaluating and resolving
* unknown data
* </ul>
*
* @deprecated Migrate to the planner's asynchronous evaluation ({@link
* CelRuntimeFactory#plannerRuntimeBuilder()}, {@code CelFunctionBinding.fromAsync}, and {@code
* Program.evalAsync}).
*/
@Deprecated
@ThreadSafe
public interface CelAsyncRuntime {

/** AsyncProgram wraps a CEL Program with a driver to resolve unknowns as they are encountered. */
/**
* AsyncProgram wraps a CEL Program with a driver to resolve unknowns as they are encountered.
*
* @deprecated Migrate to {@code Program.evalAsync} (see {@link CelAsyncRuntime}).
*/
@Deprecated
interface AsyncProgram {
ListenableFuture<Object> evaluateToCompletion(
CelResolvableAttributePattern... resolvableAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@

import com.google.errorprone.annotations.CanIgnoreReturnValue;
import dev.cel.runtime.CelRuntime;
import dev.cel.runtime.CelRuntimeFactory;
import java.util.concurrent.ExecutorService;

/** Builder interface for {@link CelAsyncRuntime}. */
/**
* Builder interface for {@link CelAsyncRuntime}.
*
* @deprecated Migrate to the planner's asynchronous evaluation ({@link
* CelRuntimeFactory#plannerRuntimeBuilder()}, {@code CelFunctionBinding.fromAsync}, and {@code
* Program.evalAsync}).
*/
@Deprecated
public interface CelAsyncRuntimeBuilder {
int DEFAULT_MAX_EVALUATE_ITERATIONS = 10;

Expand Down Expand Up @@ -58,5 +66,6 @@ public interface CelAsyncRuntimeBuilder {
@CanIgnoreReturnValue
CelAsyncRuntimeBuilder setExecutorService(ExecutorService executorService);

@SuppressWarnings("deprecation") // Retained on deprecated CelAsyncRuntimeBuilder
CelAsyncRuntime build();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,23 @@

package dev.cel.runtime.async;

/** Factory for default {@link CelAsyncRuntime}. */
import dev.cel.runtime.CelRuntimeFactory;

/**
* Factory for default {@link CelAsyncRuntime}.
*
* @deprecated Migrate to the planner's asynchronous evaluation ({@link
* CelRuntimeFactory#plannerRuntimeBuilder()}, {@code CelFunctionBinding.fromAsync}, and {@code
* Program.evalAsync}).
*/
@Deprecated
public final class CelAsyncRuntimeFactory {

/**
* @deprecated See {@link CelAsyncRuntimeFactory}.
*/
@Deprecated
@SuppressWarnings("deprecation") // Retained on deprecated CelAsyncRuntimeFactory
public static CelAsyncRuntimeBuilder defaultAsyncRuntime() {
return CelAsyncRuntimeImpl.newBuilder();
}
Expand Down
Loading