# I want my worker to stop polling and executing tasks when the process is being terminated (Java client)

**URL:** <https://community.orkes.io/t/i-want-my-worker-to-stop-polling-and-executing-tasks-when-the-process-is-being-terminated-java-client/49>\
**Category:** FAQ\
**Tags:** faq, conductor-oss, java\
**Created:** [January 2, 2025, 6:35pm UTC](https://community.orkes.io/t/i-want-my-worker-to-stop-polling-and-executing-tasks-when-the-process-is-being-terminated-java-client/49 "2025-01-02T18:35:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff.bull](https://sea2.discourse-cdn.com/flex002/user_avatar/community.orkes.io/jeff.bull/32/3_2.png) [@jeff.bull](https://community.orkes.io/u/jeff.bull)\
**Post date:** [January 2, 2025, 6:35pm UTC](https://community.orkes.io/t/i-want-my-worker-to-stop-polling-and-executing-tasks-when-the-process-is-being-terminated-java-client/49/1 "2025-01-02T18:35:52Z")

</div>

In a `PreDestroy` block within your application, call the `shutdown()` method on the `TaskRunnerConfigurer` instance that you have created to facilitate a graceful shutdown of your worker in case the process is being terminated.
