# nameko stuck in a self.\_\_dispatch() call for a service sending an event to another service

**URL:** <https://discourse.nameko.io/t/nameko-stuck-in-a-self-dispatch-call-for-a-service-sending-an-event-to-another-service/267>\
**Category:** googlegroup\
**Created:** [August 1, 2018, 11:35am UTC](https://discourse.nameko.io/t/nameko-stuck-in-a-self-dispatch-call-for-a-service-sending-an-event-to-another-service/267 "2018-08-01T11:35:42Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mattbennett](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/mattbennett/32/13_2.png) [@mattbennett](https://discourse.nameko.io/u/mattbennett)\
**Post date:** [August 10, 2018, 12:00pm UTC](https://discourse.nameko.io/t/nameko-stuck-in-a-self-dispatch-call-for-a-service-sending-an-event-to-another-service/267/5 "2018-08-10T12:00:23Z")

</div>

Ah, I see what you’re trying to do now.

A Nameko entrypoint for NATS is absolutely the way to go. It’s not too difficult to [create entrypoints](http://docs.nameko.io/en/stable/writing_extensions.html#writing-entrypoints); if there was a Python NATS library that wasn’t tied to an eventloop (I only see the asyncio and tornado versions) it would be easy.

I don’t know about integrating asyncio-based libraries into an eventlet ecosystem though. I think you could probably put the reader loop into a [tpool](http://eventlet.net/doc/threading.html#tpool-simple-thread-pool)

There is no timeout for workers so your eventloop-in-worker would keep running until it voluntarily stops. This would be a weird pattern though, I’d recommend trying to refactor your NATS consumer into a proper entrypoint if you can.

---

_[View the full topic](https://discourse.nameko.io/t/nameko-stuck-in-a-self-dispatch-call-for-a-service-sending-an-event-to-another-service/267)._
