r/Python • • Apr 12 '20

I Made This Python package: Polycephaly

Per /u/real_confusedswede public suggestion to post here with flair (thanks for the suggestion btw):

Polycephaly
Easily create system daemons (and programs) that use an email-like syntax for communicating between threaded and forked processes.

The upcoming release (that I haven't pushed yet) will add in real-time communications, with special focus on MQTT.

If you don't know how to create and release a package for PyPi, I gave a talk at the Austin Python Meetup in January about how to do so, and will try to answer any questions on here, or on LinkedIn.

Best regards, all.

3 Upvotes

4 comments sorted by

3

u/Goldragon979 Apr 12 '20

Interesting. Could you provide a real life example where this library would help beyond using standard threads and queues ?

2

u/LTGIV Apr 12 '20

Hi, it started as an internal project for commercial robotics driven by a large touchscreen.

The touchscreen is a GUI running unprivileged under a limited window manager in a group that's shared with a privileged (systemd-based) service that's also built with this package and sharing said group. These two communicate on a Unix Domain Socketfile that's set to the group of the unprivileged GUI and the privileged service.

The most notable use in this scenario was the privileged system service. Threads/Forks that were stable could be left alone (e.g. for driving network configuration, system updates, etc.), while as other functionality that was being added/fixed could be literally dropped in as a file, then systemctl restart could be called. This resulted in reduced work since those specific threads/processes could be adjusted/tested offline before pushed as an add-on (or a replacement).

I'm still moving a lot of the working portions from the private (and ugly as well as undocumented) side of things to the public side, and this is all very much a work in progress.

2

u/hazzeddd Apr 12 '20

This is intresting!

1

u/LTGIV Apr 12 '20

Thanks!