use of com.github.jamesnetherton.zulip.client.api.event.request.DeleteEventQueueApiRequest in project zulip-java-client by jamesnetherton.
the class EventPoller method stop.
/**
* Stops message polling.
*/
public synchronized void stop() {
if (status.equals(Status.STARTING) || status.equals(Status.STARTED)) {
try {
LOG.info("EventPoller stopping");
status = Status.STOPPING;
executor.shutdown();
DeleteEventQueueApiRequest deleteQueue = new DeleteEventQueueApiRequest(this.client, queue.getQueueId());
deleteQueue.execute();
} catch (ZulipClientException e) {
LOG.warning("Error deleting event queue - " + e.getMessage());
} finally {
LOG.info("EventPoller stopped");
executor = null;
status = Status.STOPPED;
}
}
}
Aggregations