# context.getExecutionManager().register() blocking due to request timeouts

**URL:** <https://forum.inductiveautomation.com/t/context-getexecutionmanager-register-blocking-due-to-request-timeouts/40509>\
**Category:** Module Development\
**Tags:** ignition80\
**Created:** [November 10, 2020, 9:25pm UTC](https://forum.inductiveautomation.com/t/context-getexecutionmanager-register-blocking-due-to-request-timeouts/40509 "2020-11-10T21:25:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [November 10, 2020, 9:25pm UTC](https://forum.inductiveautomation.com/t/context-getexecutionmanager-register-blocking-due-to-request-timeouts/40509/1 "2020-11-10T21:25:36Z")

</div>

Hello,

I am trying to register timed threads that are non blocking. I was previously using the context.getExecutionManager().register() call to registers my workers, however this was causing thread starvation as advertised in the javadoc.

Is there an equivalent method that is recommended for use in a thread that could be blocking?

My threads are constantly performing REST calls. I need to ensure that the threads wont cause starvation if one thread is hung up on a request timeout.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 10, 2020, 9:36pm UTC](https://forum.inductiveautomation.com/t/context-getexecutionmanager-register-blocking-due-to-request-timeouts/40509/2 "2020-11-10T21:36:57Z")

</div>

There’s nothing wrong with creating an `ExecutorService` that your module uses exclusively to run these blocking REST calls on. You don’t need to use the platform ExecutionManager.

Create it with a fixed size if you’re worried about how many can be outstanding at any given time. Provide a ThreadFactory when you create the service so the threads can be identified as belonging to your module.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 10, 2020, 10:12pm UTC](https://forum.inductiveautomation.com/t/context-getexecutionmanager-register-blocking-due-to-request-timeouts/40509/3 "2020-11-10T22:12:02Z")

</div>

You can also create a Java HTTPClient with its own dedicated thread pool and do your own async calls from that (probably best as a singleton) instance.

---

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [November 11, 2020, 2:40pm UTC](https://forum.inductiveautomation.com/t/context-getexecutionmanager-register-blocking-due-to-request-timeouts/40509/4 "2020-11-11T14:40:49Z")

</div>

I will try this out, I think it makes sense for my module. Thank you!
