Skip to content

Instantly share code, notes, and snippets.

@BrantApps
Created December 19, 2016 02:41
Show Gist options
  • Save BrantApps/fc1fa0014c40ec50c86e31423218349a to your computer and use it in GitHub Desktop.
Save BrantApps/fc1fa0014c40ec50c86e31423218349a to your computer and use it in GitHub Desktop.
Failing Rx-ness
Observable.zip(
Observable.from(spots),
Observable.interval(SYNC_TICK, TimeUnit.MILLISECONDS),
(obs, timer) -> obs)
.subscribeOn(scheduler)
.observeOn(scheduler)
.unsubscribeOn(scheduler)
.flatMap(spot -> syncTidePosition.get().buildObservable(spot))
.subscribe(spotAndTideEvent -> new TideEventSubscriber(
lunaEventService,
synchronisationIntentProvider.get(),
spotAndTideEvent.spot,
String.format(
getString(string.tide_error_message),
spotAndTideEvent.spot.getTidePosition()
),
errorHandlerService,
localBroadcastManager)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment