Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow
Interface WorkflowClock

All Known Implementing Classes:
TestWorkflowClock

public interface WorkflowClock

Clock that must be used inside workflow definition code to ensure replay determinism.


Method Summary
 Promise<Void> createTimer(long delaySeconds)
          Create a Value that becomes ready after the specified delay.
<T> Promise<T>
createTimer(long delaySeconds, T context)
          Create a Value that becomes ready after the specified delay.
 long currentTimeMillis()
           
 boolean isReplaying()
          true indicates if workflow is replaying already processed events to reconstruct it state.
 

Method Detail

currentTimeMillis

long currentTimeMillis()
Returns:
time of the DecisionTask start event of the decision being processed or replayed.

isReplaying

boolean isReplaying()
true indicates if workflow is replaying already processed events to reconstruct it state. false indicates that code is making forward process for the first time. For example can be used to avoid duplicating log records due to replay.


createTimer

Promise<Void> createTimer(long delaySeconds)
Create a Value that becomes ready after the specified delay.

Parameters:
delay - time-interval after which the Value becomes ready in seconds.
Returns:
Promise that becomes ready after the specified delay.

createTimer

<T> Promise<T> createTimer(long delaySeconds,
                           T context)
Create a Value that becomes ready after the specified delay.

Parameters:
context - context object that is returned inside the value when it becomes ready.
Returns:
Promise that becomes ready after the specified delay. When ready it contains value passed as context parameter.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.