[Tutor] demon / app I/F better way ?
Kent Johnson
kent37 at tds.net
Sun Nov 14 15:29:54 CET 2004
What about running the demon as a separate thread in the main app? Use a
Queue to send data from the demon to the main app. The app checks for
data in the queue every second.
Or, use a socket connection between the demon and the main app...
Kent
Dave S wrote:
> Hi there,
>
> I am planning a python app but have hit a dilemma.
>
> I have a time critical python app that will be running constantly as a
> demon, checking a data web page for updates & archiving any changes.
> When a change occurs it needs to signal another python app that new data
> has arrived.
>
>
> OK this is the way I am planning to do this, if there is a neater way
> please shout :-D
>
> the demon dumps data in /data/data_new & also changes the state of a
> flag /data/data_flag to true when it has found new changes
>
> my main app when it is ready to accept data checks the status of
> /data/data_flag every second, if it changes to a true state reads in
> /data/data_new & sets /data/data_flag to false, performs processing then
> checks /data/data_flag ...
>
>
> This will work (I think ;-) ) but seems a bit clunky, anyone got a more
> elegant solution?
>
> Dave
>
>
>
>
>
>
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list