com.twitter.common.util
Class KestrelConsumer

java.lang.Object
  extended by com.twitter.common.util.KestrelConsumer

public class KestrelConsumer
extends Object

Class responsible for pulling work items off of a kestrel queue.


Constructor Summary
KestrelConsumer(List<String> kestrelServers, String queueName, Function<String,Boolean> taskHandler)
          Creates a new kestrel consumer that will communicate with the given kestrel servers (where a server string is formatted as host:port).
 
Method Summary
 void consumeForever()
           
 void initialize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KestrelConsumer

public KestrelConsumer(List<String> kestrelServers,
                       String queueName,
                       Function<String,Boolean> taskHandler)
Creates a new kestrel consumer that will communicate with the given kestrel servers (where a server string is formatted as host:port).

Parameters:
kestrelServers - The kestrel servers to pull work from.
queueName - The name of the kestrel queue to pull work from.
taskHandler - The handler for new work retrieved from the kestrel queue. The handler should return false if the work item was not successfully handled.
Method Detail

initialize

public void initialize()

consumeForever

public void consumeForever()