# Standalone event dispatcher pulls in eventlet

**URL:** https://discourse.nameko.io/t/standalone-event-dispatcher-pulls-in-eventlet/353
**Category:** Uncategorized
**Created:** [October 2, 2018, 5:45pm UTC](https://discourse.nameko.io/t/standalone-event-dispatcher-pulls-in-eventlet/353 "2018-10-02T17:45:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![HADDLETON\_Robert\_W\_B](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/haddleton_robert_w_b/32/20_2.png) [@HADDLETON\_Robert\_W\_B](https://discourse.nameko.io/u/HADDLETON_Robert_W_B)
#### Post date: [October 2, 2018, 5:45pm UTC](https://discourse.nameko.io/t/standalone-event-dispatcher-pulls-in-eventlet/353/1 "2018-10-02T17:45:10Z")

</div>

I’m looking at using the standalone event dispatcher from some code that uses gevent, and I noticed that importing event\_dispatcher from nameko.standalone.events also pulls in eventlet, even though it’s not used by anything in standalone/events.py

It looks like the only reason eventlet gets pulled in is because serialization.py imports import\_from\_path from nameko.utils, which pulls in eventlet for the SpawningProxy, etc.

I moved import\_from\_path into it’s own file (pathutils.py) and verified that I can import event\_dispatcher without pulling in eventlet.

What would you think about a PR to move import\_from\_path into it’s own file? Unfortunately it can’t go in utils since utils/ **init**.py imports eventlet and has the bulk of the utils code in it.

Any better suggestions?

Thanks,

Bob

---

<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: [October 3, 2018, 8:07am UTC](https://discourse.nameko.io/t/standalone-event-dispatcher-pulls-in-eventlet/353/2 "2018-10-03T08:07:36Z")

</div>

Hi Bob,

Thanks for reporting this. Out of curiosity, what is the side-effect of importing eventlet under gevent? The monkey-patch should not be applied, so I assumed it was harmless.

It is a bit silly that the standalone proxy imports eventlet though. It’s also inconsistent that in order to _install_ the standalone proxy you must install eventlet (since it’s included in nameko’s requirements list).

I would happily accept a pull request that shuffled things around though. Maybe the solution is to move the eventlet-requiring utilities to `nameko.utils.concurrency` or similar. `SpawningSet` et al should only be used inside the core library so I’m not too worried about maintaining backwards-compatible paths for input.

---

<div class="post-metadata">

### Author: ![HADDLETON\_Robert\_W\_B](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/haddleton_robert_w_b/32/20_2.png) [@HADDLETON\_Robert\_W\_B](https://discourse.nameko.io/u/HADDLETON_Robert_W_B)
#### Post date: [October 3, 2018, 6:09pm UTC](https://discourse.nameko.io/t/standalone-event-dispatcher-pulls-in-eventlet/353/3 "2018-10-03T18:09:19Z")

</div>

Hi Matt,

I don’t know of any specific side-effects, I’m just trying to keep my core set of modules as “clean” as possible, to avoid debugging strange interactions, and it seemed like a good idea to minimize what gets imported by the standalone event\_dispatcher.

I’ll push a PR and we can iterate on the changes.

Thanks!

Bob
