title: RxAndroidBle how to do write to ble device correctly?
body: <p>Hi i am trying to build my first app with RxJava and BLE and i have a question: I  made a wite(byte b) method in singletone class(that i use for connection, notifications, etc..). So now if i want to write data to BLE device i call this method. I need to do this a lot  from different parts of code. I am very new to RxJava concept, and i feel like i am doing wrong.
  Current solution:</p>
  
  <pre><code>public void write(byte[] b) {
  
          if (isConnected()) {
              connectionObservable
                      .flatMap(rxBleConnection -&gt; rxBleConnection.writeCharacteristic(characteristicUuid, b))
                      .subscribe(bytes -&gt; {
                          onWriteSuccess(bytes);
                      }, this::onWriteFailure);
          }
  
      }
  </code></pre>
  
  <p>I feel like i need to do something like that, but i dont know how:</p>
  
  <pre><code> protected static final BlockingQueue&lt;byte[]&gt; TxQueue = new ArrayBlockingQueue&lt;&gt;(32);
  
   public void write(byte[] b) {
  
         TxQueue.add(bytes);
  
      }
  </code></pre>
  
  <p>And call this only once during connection to device:</p>
  
  <pre><code>connectionObservable
                      .flatMap(rxBleConnection -&gt;     rxBleConnection.writeCharacteristic(characteristicUuid, TxQueue.take))
                      .subscribe(bytes -&gt; {
                          onWriteSuccess(bytes);
                      }, this::onWriteFailure);
  </code></pre>
  
  <p>Thanks for an answer!</p>