public interface AscendClient
| Modifier and Type | Method and Description |
|---|---|
void |
confirm()
Sends a confirmed event to Ascend.
|
void |
contaminate()
Sends a contamination event to Ascend.
|
void |
emitEvent(java.lang.String key)
Emits a generic event to be recorded by Ascend.
|
void |
emitEvent(java.lang.String key,
java.lang.Double score)
Emits a generic event to be recorded by Ascend.
|
<T> T |
get(java.lang.String key,
T defaultValue)
Retrieves a value from the participant's allocation, returns a default upon error.
|
<T> void |
subscribe(java.lang.String key,
T defaultValue,
AscendAction<T> function)
Retrieves a value from Ascend asynchronously and applies some custom action.
|
<T> T get(java.lang.String key,
T defaultValue)
Given a unique key this method will retrieve the key's associated value. A default value can also be specified in case any errors occur during the values retrieval. If the allocation call times out or fails the default value is always returned. This method is blocking, it will wait till the allocation is available and then return.
T - type of value to be returnedkey - a unique key identifying a specific value in the participants
allocationdefaultValue - a default value to return upon error<T> void subscribe(java.lang.String key,
T defaultValue,
AscendAction<T> function)
This method is non blocking. It will preform the programmed action once the allocation is available. If there is already of stored allocation it will immediately apply the value retrieved and then when the new allocation returns it will reapply the new changes if the experiment has changed.
T - type of value to be returnedkey - a unique key identifying a specific value in the participants
allocationdefaultValue - a default value to return upon errorfunction - a handler that is invoked when the allocation is updatedvoid emitEvent(java.lang.String key,
java.lang.Double score)
Sends an event to Ascend to be recorded and reported upon. Also records a generic score value to be associated with the event.
key - the identifier of the eventscore - a score to be associated with the eventvoid emitEvent(java.lang.String key)
Sends an event to Ascend to be recorded and reported upon.
key - the identifier of the eventvoid confirm()
Method produces a confirmed event which confirms the participant's allocation. Method will not do anything in the event that the allocation timed out or failed.
void contaminate()
Method produces a contamination event which will contaminate the participant's allocation. Method will not do anything in the event that the allocation timed out or failed.