Reactive-Billing icon indicating copy to clipboard operation
Reactive-Billing copied to clipboard

isBillingSupported blocks scheduler indefinitely

Open dpkirchner opened this issue 8 years ago • 2 comments

The answer to the question in BaseObservable:

        // freeze the current RX thread until service is connected
        // because bindService() will call the connection callback on the main thread
        // we want to get back on the current RX thread
        ReactiveBillingLogger.log("Acquire semaphore until service is ready (thread %s)", Thread.currentThread().getName());
        semaphore.acquireUninterruptibly();

        // once the semaphore is released
        // it means that the service is connected and available
        //TODO: what happens if the service is never connected?
        deliverBillingService(subscriber);

seems to be "it blocks the scheduler thread forever". Ideally there'd be a way to use a timeout operator here, is there a reason that wouldn't work?

dpkirchner avatar Aug 08 '16 14:08 dpkirchner

That would be better indeed. I'm also planning to invest more time into this threading issue, because current "blocking thread" solution does not seem to be the best solution.

lukaspili avatar Feb 14 '17 21:02 lukaspili

Any update on this?

mruijzendaal avatar May 23 '17 20:05 mruijzendaal