Class PreviewContext


  • public class PreviewContext
    extends java.lang.Object
    Preview of new context features. Please note that the methods in this class may break between minor releases, use with caution!

    In order to use these methods, you MUST enable the preview context, through the endpoint builders using enablePreviewContext().

    • Constructor Summary

      Constructors 
      Constructor Description
      PreviewContext()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void run​(Context ctx, dev.restate.sdk.common.RetryPolicy retryPolicy, dev.restate.sdk.common.function.ThrowingRunnable runnable)
      Like Context.run(ThrowingRunnable), but using a custom retry policy.
      static <T> T run​(Context ctx, dev.restate.sdk.common.Serde<T> serde, dev.restate.sdk.common.RetryPolicy retryPolicy, dev.restate.sdk.common.function.ThrowingSupplier<T> action)
      Like Context.run(Serde, ThrowingSupplier), but using a custom retry policy.
      static void run​(Context ctx, java.lang.String name, dev.restate.sdk.common.RetryPolicy retryPolicy, dev.restate.sdk.common.function.ThrowingRunnable runnable)
      Like Context.run(String, ThrowingRunnable), but using a custom retry policy.
      static <T> T run​(Context ctx, java.lang.String name, dev.restate.sdk.common.Serde<T> serde, dev.restate.sdk.common.RetryPolicy retryPolicy, dev.restate.sdk.common.function.ThrowingSupplier<T> action)
      Like Context.run(String, Serde, ThrowingSupplier), but using a custom retry policy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PreviewContext

        public PreviewContext()
    • Method Detail

      • run

        public static <T> T run​(Context ctx,
                                java.lang.String name,
                                dev.restate.sdk.common.Serde<T> serde,
                                dev.restate.sdk.common.RetryPolicy retryPolicy,
                                dev.restate.sdk.common.function.ThrowingSupplier<T> action)
                         throws dev.restate.sdk.common.TerminalException
        Like Context.run(String, Serde, ThrowingSupplier), but using a custom retry policy.

        When a retry policy is not specified, the run will be retried using the Restate invoker retry policy, which by default retries indefinitely.

        Throws:
        dev.restate.sdk.common.TerminalException
      • run

        public static void run​(Context ctx,
                               java.lang.String name,
                               dev.restate.sdk.common.RetryPolicy retryPolicy,
                               dev.restate.sdk.common.function.ThrowingRunnable runnable)
                        throws dev.restate.sdk.common.TerminalException
        Like Context.run(String, ThrowingRunnable), but using a custom retry policy.

        When a retry policy is not specified, the run will be retried using the Restate invoker retry policy, which by default retries indefinitely.

        Throws:
        dev.restate.sdk.common.TerminalException
      • run

        public static <T> T run​(Context ctx,
                                dev.restate.sdk.common.Serde<T> serde,
                                dev.restate.sdk.common.RetryPolicy retryPolicy,
                                dev.restate.sdk.common.function.ThrowingSupplier<T> action)
                         throws dev.restate.sdk.common.TerminalException
        Like Context.run(Serde, ThrowingSupplier), but using a custom retry policy.

        When a retry policy is not specified, the run will be retried using the Restate invoker retry policy, which by default retries indefinitely.

        Throws:
        dev.restate.sdk.common.TerminalException
      • run

        public static void run​(Context ctx,
                               dev.restate.sdk.common.RetryPolicy retryPolicy,
                               dev.restate.sdk.common.function.ThrowingRunnable runnable)
                        throws dev.restate.sdk.common.TerminalException
        Like Context.run(ThrowingRunnable), but using a custom retry policy.

        When a retry policy is not specified, the run will be retried using the Restate invoker retry policy, which by default retries indefinitely.

        Throws:
        dev.restate.sdk.common.TerminalException