All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wavefront.agent.handlers.SenderTask Maven / Gradle / Ivy

There is a newer version: 9999.0
Show newest version
package com.wavefront.agent.handlers;

import com.wavefront.agent.data.QueueingReason;
import com.wavefront.common.Managed;

import javax.annotation.Nullable;

/**
 * Batch and ship valid items to Wavefront servers
 *
 * @author [email protected]
 *
 * @param  the type of input objects handled.
 */
public interface SenderTask extends Managed {

  /**
   * Add valid item to the send queue (memory buffers).
   *
   * @param item item to add to the send queue.
   */
  void add(T item);

  /**
   * Calculate a numeric score (the lower the better) that is intended to help the
   * {@link ReportableEntityHandler} choose the best SenderTask to handle over data to.
   *
   * @return task score
   */
  long getTaskRelativeScore();

  /**
   * Force memory buffer flush.
   *
   * @param reason reason for queueing.
   */
  void drainBuffersToQueue(@Nullable QueueingReason reason);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy