You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@
27
27
```
28
28
29
29
*Note: The SDK uses a standard interface for the http backend see [HttpClient.](https://github.com/evolv-ai/ascend-java-sdk/blob/master/src/main/java/ai/evolv/HttpClient.java).
30
-
When configuring the client you must specify what implementation of HttpClient to use (or implement your own).*
30
+
When configuring the client you must specify what implementation of HttpClient to use (or implement your own). See "Custom Http Backend" for more details.*
31
31
32
32
2. Initialize the AscendClient.
33
33
```java
@@ -70,12 +70,12 @@ subscribe to a value and apply any actions as a result of it asynchronously.
70
70
requested value, the default value will be returned in its place. If you have a previous allocation stored the
71
71
value will be retrieved and then your code will be executed. When the new allocation is retrieved if the value
72
72
differs from the previously stored allocation then your code will be ran again with the new value. If your code
73
-
results in an Exception it will be thrown.*
73
+
results in an Exception it will be logged but no runtime exception is thrown.*
74
74
75
75
### Custom Events (optional)
76
76
77
77
Sometimes you may want to record certain events that occurred during the participant's session. An example of an event
78
-
thats important to record is a "conversion" event. If you implemented the SDK in a shopping app, you could send the
78
+
that is important to record is a "conversion" event. If you implemented the SDK in a shopping app, you could send the
79
79
"conversion" event when the participant presses the checkout button.
80
80
81
81
1. Emit a custom event.
@@ -99,6 +99,23 @@ Sometimes it may be necessary to contaminate the participant's allocation. Meani
99
99
client.contaminate();
100
100
```
101
101
102
+
103
+
### Custom Http Backend
104
+
105
+
The Ascend Client uses a standard Http interface for making Http requests to the Participant API, see [HttpClient.](https://github.com/evolv-ai/ascend-java-sdk/blob/master/src/main/java/ai/evolv/HttpClient.java)
106
+
We have built a couple of implementations that are available out of the box, you can also feel free to create your own. At initialization you will need to pass in the HttpClient that you want to use to the
107
+
AscendConfig class.
108
+
109
+
1. Choose an HttpClient and pass it to the AscendConfig.
110
+
111
+
```java
112
+
HttpClient httpClient = new AsyncHttpClientImpl(<request_timeout>);
*Note: The above HttpClient implementation uses org.asynchttpclient:async-http-client as its http client. In order to use
117
+
the implementation you will need to bring the package into your dependencies.*
118
+
102
119
### Custom Allocation Store (optional)
103
120
104
121
Once a participant has been allocated into an experiment you may want to retain the allocations they received. To do this, create a custom allocation store by implementing the AscendAllocationStore interface. You can supply the
0 commit comments