Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77778 > unrolled thread

Re: Example of python service running under systemd?

Started byTravis Griggs <travisgriggs@gmail.com>
First post2014-09-11 14:06 -0700
Last post2014-09-11 14:06 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Example of python service running under systemd? Travis Griggs <travisgriggs@gmail.com> - 2014-09-11 14:06 -0700

#77778 — Re: Example of python service running under systemd?

FromTravis Griggs <travisgriggs@gmail.com>
Date2014-09-11 14:06 -0700
SubjectRe: Example of python service running under systemd?
Message-ID<mailman.13942.1410469620.18130.python-list@python.org>
On Sep 11, 2014, at 11:18 AM, Chris “Kwpolska” Warrick <kwpolska@gmail.com> wrote:

> Depends what you want. 

Mine is not a web service. My main.py looks like this:

#!/usr/bin/env python3

import cycle
import pushTelemetry
from threading import Thread

def main():
    Thread(target=pushTelemetry.udpLoop).start()
    Thread(target=cycle.cycleLoop).start()

if __name__ == '__main__':
    main()

It basically creates two threads, one which does some local processing and control, the other which periodically does reporting via udp packets. I use the dual threads because they both work with a shared serial port at times, so I have to synchronize access through that.

What I want is to have this startup, after my board has it’s networking layer up and running (and hopefully a valid ip address by then), and to just keep running forever

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web