Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save clebertsuconic/1d9c5e84bf098ecc5edf08c6662ee746 to your computer and use it in GitHub Desktop.
Save clebertsuconic/1d9c5e84bf098ecc5edf08c6662ee746 to your computer and use it in GitHub Desktop.
public synchronized void cancelRedistributor() throws Exception
{
if (redistributor != null)
{
redistributor.stop();
Redistributor redistributorToRemove = redistributor;
redistributor = null;
removeConsumer(redistributorToRemove);
}
if (redistributorFuture != null)
{
redistributorFuture.cancel(false);
futures.remove(redistributorFuture);
redistributorFuture = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment