2424import com .uber .cadence .internal .sync .WorkflowInternal ;
2525import com .uber .cadence .worker .WorkerOptions ;
2626import com .uber .cadence .workflow .Functions .Func ;
27- import com .uber .cadence .workflow .Functions .Func1 ;
28- import com .uber .cadence .workflow .Functions .Func2 ;
29- import com .uber .cadence .workflow .Functions .Proc ;
3027import com .uber .m3 .tally .Scope ;
3128import java .lang .reflect .Type ;
3229import java .time .Duration ;
156153 * methods allow you to invoke any activity asynchronously. The call returns a {@link Promise}
157154 * result immediately. {@link Promise} is similar to both {@link java.util.concurrent.Future} and
158155 * {@link java.util.concurrent.CompletionStage}. The {@link Promise#get()} blocks until a result is
159- * available. It also exposes the {@link Promise#thenApply(Func1)} and {@link Promise#handle(Func2)}
160- * methods. See the {@link Promise} documentation for technical details about differences with
161- * {@link java.util.concurrent.Future}.
156+ * available. It also exposes the {@link Promise#thenApply(Functions. Func1)} and {@link
157+ * Promise#handle(Functions.Func2)} methods. See the {@link Promise} documentation for technical
158+ * details about differences with {@link java.util.concurrent.Future}.
162159 *
163160 * <p>To convert a synchronous call
164161 *
165162 * <pre><code>
166163 * String localName = activities.download(sourceBucket, sourceFile);
167164 * </code></pre>
168165 *
169- * to asynchronous style, the method reference is passed to {@link Async#function(Func)} or {@link
170- * Async#procedure(Proc)} followed by activity arguments:
166+ * to asynchronous style, the method reference is passed to {@link Async#function(Functions. Func)}
167+ * or {@link Async#procedure(Functions. Proc)} followed by activity arguments:
171168 *
172169 * <pre><code>
173170 * Promise<String> localNamePromise = Async.function(activities::download, sourceBucket, sourceFile);
243240 *
244241 * <p>The first call to the child workflow stub must always be to a method annotated with
245242 * {@literal @}{@link WorkflowMethod}. Similarly to activities, a call can be synchronous or
246- * asynchronous using {@link Async#function(Func)} or {@link Async#procedure(Proc)}. The synchronous
247- * call blocks until a child workflow completes. The asynchronous call returns a {@link Promise}
248- * that can be used to wait for the completion. After an async call returns the stub, it can be used
249- * to send signals to the child by calling methods annotated with {@literal @}{@link SignalMethod}.
250- * Querying a child workflow by calling methods annotated with {@literal @}{@link QueryMethod} from
251- * within workflow code is not supported. However, queries can be done from activities using the
252- * {@link com.uber.cadence.client.WorkflowClient} provided stub.
243+ * asynchronous using {@link Async#function(Functions.Func)} or {@link
244+ * Async#procedure(Functions.Proc)}. The synchronous call blocks until a child workflow completes.
245+ * The asynchronous call returns a {@link Promise} that can be used to wait for the completion.
246+ * After an async call returns the stub, it can be used to send signals to the child by calling
247+ * methods annotated with {@literal @}{@link SignalMethod}. Querying a child workflow by calling
248+ * methods annotated with {@literal @}{@link QueryMethod} from within workflow code is not
249+ * supported. However, queries can be done from activities using the {@link
250+ * com.uber.cadence.client.WorkflowClient} provided stub.
253251 *
254252 * <pre><code>
255253 * public interface GreetingChild {
338336 * for this.
339337 * <li>Only use {@link #currentTimeMillis()} to get the current time inside a workflow.
340338 * <li>Do not use native Java {@link Thread} or any other multi-threaded classes like {@link
341- * java.util.concurrent.ThreadPoolExecutor}. Use {@link Async#function(Func)} or {@link
342- * Async#procedure(Proc)} to execute code asynchronously.
339+ * java.util.concurrent.ThreadPoolExecutor}. Use {@link Async#function(Functions. Func)} or
340+ * {@link Async#procedure(Functions. Proc)} to execute code asynchronously.
343341 * <li>Don't use any synchronization, locks, and other standard Java blocking concurrency-related
344342 * classes besides those provided by the Workflow class. There is no need in explicit
345343 * synchronization because multi-threaded code inside a workflow is executed one thread at a
@@ -904,7 +902,7 @@ public static boolean isReplaying() {
904902 * @param resultClass type of the side effect
905903 * @param func function that returns side effect value
906904 * @return value of the side effect
907- * @see #mutableSideEffect(String, Class, BiPredicate, Func)
905+ * @see #mutableSideEffect(String, Class, BiPredicate, Functions. Func)
908906 */
909907 public static <R > R sideEffect (Class <R > resultClass , Func <R > func ) {
910908 return WorkflowInternal .sideEffect (resultClass , resultClass , func );
@@ -959,21 +957,22 @@ public static <R> R sideEffect(Class<R> resultClass, Func<R> func) {
959957 * @param resultType type of the side effect. Differs from resultClass for generic types.
960958 * @param func function that returns side effect value
961959 * @return value of the side effect
962- * @see #mutableSideEffect(String, Class, BiPredicate, Func)
960+ * @see #mutableSideEffect(String, Class, BiPredicate, Functions. Func)
963961 */
964962 public static <R > R sideEffect (Class <R > resultClass , Type resultType , Func <R > func ) {
965963 return WorkflowInternal .sideEffect (resultClass , resultType , func );
966964 }
967965
968966 /**
969- * {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Func)} in allowing calls of
970- * non-deterministic functions from workflow code.
967+ * {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Functions. Func)} in allowing
968+ * calls of non-deterministic functions from workflow code.
971969 *
972- * <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class, Func)} is
973- * that every new {@code sideEffect} call in non-replay mode results in a new marker event
974- * recorded into the history. However, {@code mutableSideEffect} only records a new marker if a
975- * value has changed. During the replay, {@code mutableSideEffect} will not execute the function
976- * again, but it will return the exact same value as it was returning during the non-replay run.
970+ * <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class,
971+ * Functions.Func)} is that every new {@code sideEffect} call in non-replay mode results in a new
972+ * marker event recorded into the history. However, {@code mutableSideEffect} only records a new
973+ * marker if a value has changed. During the replay, {@code mutableSideEffect} will not execute
974+ * the function again, but it will return the exact same value as it was returning during the
975+ * non-replay run.
977976 *
978977 * <p>One good use case of {@code mutableSideEffect} is to access a dynamically changing config
979978 * without breaking determinism. Even if called very frequently the config value is recorded only
@@ -991,22 +990,23 @@ public static <R> R sideEffect(Class<R> resultClass, Type resultType, Func<R> fu
991990 * for the first value.
992991 * @param resultClass class of the side effect
993992 * @param func function that produces a value. This function can contain non deterministic code.
994- * @see #sideEffect(Class, Func)
993+ * @see #sideEffect(Class, Functions. Func)
995994 */
996995 public static <R > R mutableSideEffect (
997996 String id , Class <R > resultClass , BiPredicate <R , R > updated , Func <R > func ) {
998997 return WorkflowInternal .mutableSideEffect (id , resultClass , resultClass , updated , func );
999998 }
1000999
10011000 /**
1002- * {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Func)} in allowing calls of
1003- * non-deterministic functions from workflow code.
1001+ * {@code mutableSideEffect} is similar to {@link #sideEffect(Class, Functions. Func)} in allowing
1002+ * calls of non-deterministic functions from workflow code.
10041003 *
1005- * <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class, Func)} is
1006- * that every new {@code sideEffect} call in non-replay mode results in a new marker event
1007- * recorded into the history. However, {@code mutableSideEffect} only records a new marker if a
1008- * value has changed. During the replay, {@code mutableSideEffect} will not execute the function
1009- * again, but it will return the exact same value as it was returning during the non-replay run.
1004+ * <p>The difference between {@code mutableSideEffect} and {@link #sideEffect(Class,
1005+ * Functions.Func)} is that every new {@code sideEffect} call in non-replay mode results in a new
1006+ * marker event recorded into the history. However, {@code mutableSideEffect} only records a new
1007+ * marker if a value has changed. During the replay, {@code mutableSideEffect} will not execute
1008+ * the function again, but it will return the exact same value as it was returning during the
1009+ * non-replay run.
10101010 *
10111011 * <p>One good use case of {@code mutableSideEffect} is to access a dynamically changing config
10121012 * without breaking determinism. Even if called very frequently the config value is recorded only
@@ -1025,7 +1025,7 @@ public static <R> R mutableSideEffect(
10251025 * @param resultClass class of the side effect
10261026 * @param resultType type of the side effect. Differs from resultClass for generic types.
10271027 * @param func function that produces a value. This function can contain non deterministic code.
1028- * @see #sideEffect(Class, Func)
1028+ * @see #sideEffect(Class, Functions. Func)
10291029 */
10301030 public static <R > R mutableSideEffect (
10311031 String id , Class <R > resultClass , Type resultType , BiPredicate <R , R > updated , Func <R > func ) {
@@ -1134,8 +1134,8 @@ public static Scope getMetricsScope() {
11341134 }
11351135
11361136 /**
1137- * Get logger to use inside workflow. Logs in replay mode are omitted unless {@param
1138- * enableLoggingInReplay} is set to true in {@link WorkerOptions} when a worker starts up.
1137+ * Get logger to use inside workflow. Logs in replay mode are omitted unless enableLoggingInReplay
1138+ * is set to true in {@link WorkerOptions} when a worker starts up.
11391139 *
11401140 * @param clazz class name to appear in logging.
11411141 * @return logger to use in workflow logic.
@@ -1145,8 +1145,8 @@ public static Logger getLogger(Class<?> clazz) {
11451145 }
11461146
11471147 /**
1148- * Get logger to use inside workflow. Logs in replay mode are omitted unless {@param
1149- * enableLoggingInReplay} is set to true in {@link WorkerOptions} when a worker starts up.
1148+ * Get logger to use inside workflow. Logs in replay mode are omitted unless enableLoggingInReplay
1149+ * is set to true in {@link WorkerOptions} when a worker starts up.
11501150 *
11511151 * @param name name to appear in logging.
11521152 * @return logger to use in workflow logic.
0 commit comments