public void finishPriorityTask(GenericClusterRequest clusterRequest,InputStream result){
  CountingInputStream is=new CountingInputStream(result);
  String url=BROKER_BASE_URL + String.format("/complete/priority/%s",clusterRequest.taskId);
  HttpPost httpPost=new HttpPost(url);
  httpPost.setEntity(new InputStreamEntity(is));
  taskDeliveryExecutor.execute(null);
}

public void finishPriorityTask ( GenericClusterRequest clusterRequest , InputStream result ) { CountingInputStream is = new CountingInputStream ( result ) ; String url = BROKER_BASE_URL + String . format ( "/complete/priority/%s" , clusterRequest . taskId ) ; HttpPost httpPost = new HttpPost ( url ) ; httpPost . setEntity ( new InputStreamEntity ( is ) ) ; taskDeliveryExecutor . execute ( null ) ; }
signal the broker that the given high - priority task is completed , providing a result . runs in a new thread so that input stream can be written to by the calling thread . this avoid broken pipes because the calling thread died .
