Skip to content

Commit 8b3c1a5

Browse files
Javadocs cosmetics
1 parent c02f307 commit 8b3c1a5

1 file changed

Lines changed: 21 additions & 18 deletions

File tree

sdk-api/src/main/java/dev/restate/sdk/Context.java

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
*
5757
* <h2>Thread safety</h2>
5858
*
59-
* This interface MUST NOT be accessed concurrently since it can lead to different orderings of user
60-
* actions, corrupting the execution of the invocation.
59+
* This interface <b>MUST NOT</b> be accessed concurrently since it can lead to different orderings
60+
* of user actions, corrupting the execution of the invocation.
6161
*/
6262
public interface Context {
6363

@@ -142,21 +142,6 @@ default DurableFuture<Void> timer(Duration duration) {
142142
*/
143143
DurableFuture<Void> timer(String name, Duration duration);
144144

145-
/**
146-
* Like {@link #run(String, TypeTag, ThrowingSupplier)}, but using a custom retry policy.
147-
*
148-
* <p>When a retry policy is not specified, the {@code run} will be retried using the <a
149-
* href="https://docs.restate.dev/operate/configuration/server">Restate invoker retry policy</a>,
150-
* which by default retries indefinitely.
151-
*
152-
* @see RetryPolicy
153-
*/
154-
default <T> T run(
155-
String name, TypeTag<T> typeTag, RetryPolicy retryPolicy, ThrowingSupplier<T> action)
156-
throws TerminalException {
157-
return runAsync(name, typeTag, retryPolicy, action).await();
158-
}
159-
160145
/**
161146
* Execute a non-deterministic closure, recording the result value in the journal. The result
162147
* value will be re-played in case of re-invocation (e.g. because of failure recovery or
@@ -221,6 +206,22 @@ default <T> T run(String name, Class<T> clazz, ThrowingSupplier<T> action)
221206
return run(name, TypeTag.of(clazz), action);
222207
}
223208

209+
/**
210+
* Like {@link #run(String, TypeTag, ThrowingSupplier)}, but using a custom retry policy.
211+
*
212+
* <p>When a retry policy is not specified, the {@code run} will be retried using the <a
213+
* href="https://docs.restate.dev/operate/configuration/server">Restate invoker retry policy</a>,
214+
* which by default retries indefinitely.
215+
*
216+
* @see #run(String, Class, ThrowingSupplier)
217+
* @see RetryPolicy
218+
*/
219+
default <T> T run(
220+
String name, TypeTag<T> typeTag, RetryPolicy retryPolicy, ThrowingSupplier<T> action)
221+
throws TerminalException {
222+
return runAsync(name, typeTag, retryPolicy, action).await();
223+
}
224+
224225
/**
225226
* Like {@link #run(String, Class, ThrowingSupplier)}, but using a custom retry policy.
226227
*
@@ -325,7 +326,7 @@ default void run(ThrowingRunnable runnable) throws TerminalException {
325326
* .toList();
326327
*
327328
* // Await all of them
328-
* Awaitable.all(resultFutures).await();
329+
* DurableFuture.all(resultFutures).await();
329330
*
330331
* // Fan in - Aggregate the results
331332
* var results = resultFutures.stream()
@@ -477,6 +478,8 @@ default <T> Awakeable<T> awakeable(Class<T> clazz) {
477478
AwakeableHandle awakeableHandle(String id);
478479

479480
/**
481+
* Returns a deterministic random.
482+
*
480483
* @see RestateRandom
481484
*/
482485
RestateRandom random();

0 commit comments

Comments
 (0)