Skip to content

Commit fc221d5

Browse files
(fix): default to batch event processor (#306)
* default to batch event processor * remove unused import * update to work with changed made in batch processor pr by myself * added new 3.3.2 java sdk for batch processing * remove default setting from opitimizely manager * change test app branch
1 parent 42da842 commit fc221d5

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
- SDK=android
6666
- BUILD_NUMBER=${TRAVIS_JOB_NUMBER/.}
6767
- SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
68+
- TESTAPP_BRANCH=mnoman/epBatchingSupport
6869
cache: false
6970
language: minimal
7071
before_install: skip

android-sdk/src/main/java/com/optimizely/ab/android/sdk/OptimizelyManager.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
import com.optimizely.ab.config.ProjectConfig;
4343
import com.optimizely.ab.config.parser.ConfigParseException;
4444
import com.optimizely.ab.error.ErrorHandler;
45+
import com.optimizely.ab.event.BatchEventProcessor;
4546
import com.optimizely.ab.event.EventHandler;
4647
import com.optimizely.ab.event.EventProcessor;
47-
import com.optimizely.ab.event.ForwardingEventProcessor;
4848
import com.optimizely.ab.event.internal.payload.EventBatch;
4949
import com.optimizely.ab.notification.NotificationCenter;
5050
import com.optimizely.ab.notification.UpdateConfigNotification;
@@ -56,6 +56,7 @@
5656
import java.io.InputStream;
5757
import java.util.Set;
5858

59+
5960
/**
6061
* Handles loading the Optimizely data file
6162
*/
@@ -817,7 +818,12 @@ public OptimizelyManager build(Context context) {
817818
}
818819

819820
if(eventProcessor == null) {
820-
eventProcessor = new ForwardingEventProcessor(eventHandler, notificationCenter);
821+
eventProcessor = BatchEventProcessor.builder()
822+
.withNotificationCenter(notificationCenter)
823+
.withEventHandler(eventHandler)
824+
.withFlushInterval(eventDispatchInterval)
825+
.build();
826+
821827
}
822828

823829
if (projectId == null && sdkKey == null) {

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ext {
5353
build_tools_version = "28.0.3"
5454
min_sdk_version = 14
5555
target_sdk_version = 28
56-
java_core_ver = "3.3.1"
56+
java_core_ver = "3.3.2"
5757
android_logger_ver = "1.3.6"
5858
jacksonversion= "2.9.9.1"
5959
support_annotations_ver = "24.2.1"

test-app/src/main/java/com/optimizely/ab/android/test_app/MyApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public void onCreate() {
7373
// must match the project id of the compiled in Optimizely data file in rest/raw/data_file.json.
7474

7575
OptimizelyManager.Builder builder = OptimizelyManager.builder();
76-
optimizelyManager = builder.withEventDispatchInterval(60L * 10L)
77-
.withDatafileDownloadInterval(30L)
76+
optimizelyManager = builder.withEventDispatchInterval(60L * 1000L)
77+
.withDatafileDownloadInterval(0)
7878
.withSDKKey("FCnSegiEkRry9rhVMroit4")
7979
.build(getApplicationContext());
8080
}

0 commit comments

Comments
 (0)