Class TestServiceGrpc.TestServiceStub

java.lang.Object
io.grpc.stub.AbstractStub<TestServiceGrpc.TestServiceStub>
io.grpc.stub.AbstractAsyncStub<TestServiceGrpc.TestServiceStub>
io.temporal.api.testservice.v1.TestServiceGrpc.TestServiceStub
Enclosing class:
TestServiceGrpc

public static final class TestServiceGrpc.TestServiceStub extends io.grpc.stub.AbstractAsyncStub<TestServiceGrpc.TestServiceStub>
 TestService API defines an interface supported only by the Temporal Test Server.
 It provides functionality needed or supported for testing purposes only.
 This is an EXPERIMENTAL API.
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.grpc.stub.AbstractStub

    io.grpc.stub.AbstractStub.StubFactory<T extends io.grpc.stub.AbstractStub<T>>
  • Method Summary

    Modifier and Type
    Method
    Description
    build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
     
    void
    getCurrentTime(com.google.protobuf.Empty request, io.grpc.stub.StreamObserver<GetCurrentTimeResponse> responseObserver)
    GetCurrentTime returns the current Temporal Test Server time This time might not be equal to {@link System#currentTimeMillis()} due to time skipping.
    void
    lockTimeSkipping(LockTimeSkippingRequest request, io.grpc.stub.StreamObserver<LockTimeSkippingResponse> responseObserver)
    LockTimeSkipping increments Time Locking Counter by one.
    void
    sleep(SleepRequest request, io.grpc.stub.StreamObserver<SleepResponse> responseObserver)
    This call returns only when the Test Server Time advances by the specified duration.
    void
    sleepUntil(SleepUntilRequest request, io.grpc.stub.StreamObserver<SleepResponse> responseObserver)
    This call returns only when the Test Server Time advances to the specified timestamp.
    void
    unlockTimeSkipping(UnlockTimeSkippingRequest request, io.grpc.stub.StreamObserver<UnlockTimeSkippingResponse> responseObserver)
    UnlockTimeSkipping decrements Time Locking Counter by one.
    void
    unlockTimeSkippingWithSleep(SleepRequest request, io.grpc.stub.StreamObserver<SleepResponse> responseObserver)
    UnlockTimeSkippingWhileSleep decreases time locking counter by one and increases it back once the Test Server Time advances by the duration specified in the request.

    Methods inherited from class io.grpc.stub.AbstractAsyncStub

    newStub, newStub

    Methods inherited from class io.grpc.stub.AbstractStub

    getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOnReadyThreshold, withOption, withWaitForReady

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • build

      protected TestServiceGrpc.TestServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
      Specified by:
      build in class io.grpc.stub.AbstractStub<TestServiceGrpc.TestServiceStub>
    • lockTimeSkipping

      public void lockTimeSkipping(LockTimeSkippingRequest request, io.grpc.stub.StreamObserver<LockTimeSkippingResponse> responseObserver)
       LockTimeSkipping increments Time Locking Counter by one.
       If Time Locking Counter is positive, time skipping is locked (disabled).
       When time skipping is disabled, the time in test server is moving normally, with a real time pace.
       Test Server is typically started with locked time skipping and Time Locking Counter = 1.
       LockTimeSkipping and UnlockTimeSkipping calls are counted.
       
    • unlockTimeSkipping

      public void unlockTimeSkipping(UnlockTimeSkippingRequest request, io.grpc.stub.StreamObserver<UnlockTimeSkippingResponse> responseObserver)
       UnlockTimeSkipping decrements Time Locking Counter by one.
       If the counter reaches 0, it unlocks time skipping and fast forwards time.
       LockTimeSkipping and UnlockTimeSkipping calls are counted. Calling UnlockTimeSkipping does not
       guarantee that time is going to be fast forwarded as another lock can be holding it.
       Time Locking Counter can't be negative, unbalanced calls to UnlockTimeSkipping will lead to rpc call failure
       
    • sleep

      public void sleep(SleepRequest request, io.grpc.stub.StreamObserver<SleepResponse> responseObserver)
       This call returns only when the Test Server Time advances by the specified duration.
       This is an EXPERIMENTAL API.
       
    • sleepUntil

      public void sleepUntil(SleepUntilRequest request, io.grpc.stub.StreamObserver<SleepResponse> responseObserver)
       This call returns only when the Test Server Time advances to the specified timestamp.
       If the current Test Server Time is beyond the specified timestamp, returns immediately.
       This is an EXPERIMENTAL API.
       
    • unlockTimeSkippingWithSleep

      public void unlockTimeSkippingWithSleep(SleepRequest request, io.grpc.stub.StreamObserver<SleepResponse> responseObserver)
       UnlockTimeSkippingWhileSleep decreases time locking counter by one and increases it back
       once the Test Server Time advances by the duration specified in the request.
       This call returns only when the Test Server Time advances by the specified duration.
       If it is called when Time Locking Counter is
         - more than 1 and no other unlocks are coming in, rpc call will block for the specified duration, time will not be fast forwarded.
         - 1, it will lead to fast forwarding of the time by the duration specified in the request and quick return of this rpc call.
         - 0 will lead to rpc call failure same way as an unbalanced UnlockTimeSkipping.
       
    • getCurrentTime

      public void getCurrentTime(com.google.protobuf.Empty request, io.grpc.stub.StreamObserver<GetCurrentTimeResponse> responseObserver)
       GetCurrentTime returns the current Temporal Test Server time
       This time might not be equal to {@link System#currentTimeMillis()} due to time skipping.