Class SynchronousBase
java.lang.Object
com.moesif.api.controllers.syncwrapper.SynchronousBase
- Direct Known Subclasses:
APICallBackCatcher
Base class to help convert an asynchronous callback to synchronous one
-
Constructor Summary
ConstructorsConstructorDescriptionInitiate class with a count down of one onlySynchronousBase(int count) Initiate class with a task count -
Method Summary
Modifier and TypeMethodDescriptionvoidawait()Wait until all tasks are marked as donebooleanWait until all tasks are marked as done or timeout after given timeprotected voidMark as done one task
-
Constructor Details
-
SynchronousBase
public SynchronousBase(int count) Initiate class with a task count- Parameters:
count- Number of tasks we will wait on
-
SynchronousBase
public SynchronousBase()Initiate class with a count down of one only
-
-
Method Details
-
markAsDone
protected void markAsDone()Mark as done one task -
await
Wait until all tasks are marked as done- Throws:
InterruptedException- error waiting for tasks to complete
-
await
Wait until all tasks are marked as done or timeout after given time- Parameters:
timeout- Time to waitunit- Unit for time- Returns:
- true if done
- Throws:
InterruptedException- error waiting for tasks to complete
-