Live data from Hacker News

Lahja – A generic event bus implementation written in Python

github.com

1–10 of 74 posts

Re: Lahja – A generic event bus implementation written in Python

#5
That’s pretty neat!

I’ve used Redis in the past for lightweight pub/sub and zeromq for IPC before we had adopted Python 3 (and I left that job before then). I hated juggling threads and queues before that and then having to run Redis just to run your program was a pain.

The syntax looks similar enough to both of those to get started quickly and easily.

I’ve been writing Go so much I don’t know how much this is “needed” in Python but the examples using context managers ring the “it’s Pythonic” bell.

Re: Lahja – A generic event bus implementation written in Python

#7
post #6

Love to try this out some day, a shame that this isn't in Python 2. EDIT: Thanks HN, try working in an industry where every new project is in Python 2, and have no intention to move on, before saying "moeve to 3", it doesn't help at all.

Please, please don't use Python 2.

Re: Lahja – A generic event bus implementation written in Python

#8
From glancing at the code, this is an observer pattern over asyncio and unix sockets. That means you're unable to communicate outside the current machine (short of hacks like ssh socket forwarding), but adding support for tcp endpoints shouldn't be too hard.

I'd be interested to see how well this holds up under load, especially compared to other common event bus patterns.

Re: Lahja – A generic event bus implementation written in Python

#9
post #6

Love to try this out some day, a shame that this isn't in Python 2. EDIT: Thanks HN, try working in an industry where every new project is in Python 2, and have no intention to move on, before saying "moeve to 3", it doesn't help at all.

Please don't use Python 2 for any software that anyone else will ever have to work with or maintain.

Python 2 is very close to being not supported anymore, which means no more security updates, etc.

Re: Lahja – A generic event bus implementation written in Python

#10
post #6

Love to try this out some day, a shame that this isn't in Python 2. EDIT: Thanks HN, try working in an industry where every new project is in Python 2, and have no intention to move on, before saying "moeve to 3", it doesn't help at all.

Please, please don't use Python 2.

Tell that to the industry I work in (Games, Movies & VFX) where most of the tools & 3D software scripting are still in Python 2.

Not all of us move fast and break things here, unlike the web dev world.

Post reply on HN