From 22b82777062f8020a8b2564145469d7ef37756bd Mon Sep 17 00:00:00 2001 From: Paulo Soares Date: Mon, 4 Nov 2019 14:47:05 +0100 Subject: [PATCH] fix: MissingBackpressureException --- .../src/main/java/com/polidea/reactnativeble/BleModule.java | 3 +++ package-lock.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/polidea/reactnativeble/BleModule.java b/android/src/main/java/com/polidea/reactnativeble/BleModule.java index f0d5d314..67735287 100644 --- a/android/src/main/java/com/polidea/reactnativeble/BleModule.java +++ b/android/src/main/java/com/polidea/reactnativeble/BleModule.java @@ -63,6 +63,7 @@ import rx.Observable; import rx.Observer; import rx.Subscription; +import rx.schedulers.Schedulers; import rx.functions.Action0; import rx.functions.Action1; import rx.functions.Func0; @@ -1332,6 +1333,8 @@ public Observable call(Observable observable) { return observable; } }) + .onBackpressureBuffer() + .observeOn(Schedulers.computation()) .doOnUnsubscribe(new Action0() { @Override public void call() { diff --git a/package-lock.json b/package-lock.json index ac800bca..e9891782 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-native-ble-plx", - "version": "1.0.3", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": {