title: Handling Vert.x NetSocket writeQueueFull when using EventBus
body: <p>In the <a href="https://vertx.io/docs/vertx-core/java/#streams" rel="nofollow noreferrer"><em>Vert.x</em> documentation</a>, it shows a pattern for writing to sockets that are full. </p>
  
  <pre class="lang-java prettyprint-override"><code>NetServer server = vertx.createNetServer(
      new NetServerOptions().setPort(1234).setHost("localhost")
  );
  server.connectHandler(sock -&gt; {
    sock.handler(buffer -&gt; {
      sock.write(buffer);
      if (sock.writeQueueFull()) {
        sock.pause();
        sock.drainHandler(done -&gt; {
          sock.resume();
        });
      }
    });
  }).listen();
  </code></pre>
  
  <p>How do you implement this pattern if you're writing to a socket via the <em>EventBus</em> from a different <em>Verticle</em>?</p>
  
  <p>An example:</p>
  
  <pre class="lang-java prettyprint-override"><code>vertx.eventBus().publish(writeHandlerID, buffer);
  </code></pre>