Last active
August 21, 2016 18:33
-
-
Save ragdroid/a214f2369f92e359ef1a2251e55ce237 to your computer and use it in GitHub Desktop.
Buffer - Droidcon 2016, buffer analytics events to optimize network traffic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//buffer analytics events to optimize network traffic | |
public Observable<TrackRequest> bufferundum() { | |
return getUserEventsObservable() | |
.buffer(3) //buffer count | |
.flatMap(new Func1<List<Event>, Observable<TrackRequest>>() { | |
@Override | |
public Observable<TrackRequest> call(final List<Event> events) { | |
return Observable.just(new TrackRequest(events)); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment