code: public void sendEventsFromQueue() {
          if (null == queue || stopSending) {
              return;
          }
          LOG.fine("Scheduler called for sending events");
  
          int packageSize = getEventsPerMessageCall();
  
          while (!queue.isEmpty()) {
              final List<Event> list = new ArrayList<Event>();
              int i = 0;
              while (i < packageSize && !queue.isEmpty()) {
                  Event event = queue.remove();
                  if (event != null && !filter(event)) {
                      list.add(event);
                      i++;
                  }
              }
              if (list.size() > 0) {
                  executor.execute(new Runnable() {
                      public void run() {
                          try {
                              sendEvents(list);
                          } catch (MonitoringException e) {
                              e.logException(Level.SEVERE);
                          }
                      }
                  });
  
              }
          }
  
      }
docs: Method will be executed asynchronously.