Communicating between Plugin and Background Tasks

Posted on
Tue Dec 25, 2018 8:38 am
dclonts offline
Posts: 17
Joined: Nov 05, 2006

Communicating between Plugin and Background Tasks

Maybe a dumb question, but here goes. Rewriting my AppleScript pool control software in Python.

I will use a low level serial communication task run as a thread. Running it in Background Tasks.

What is best way to communicate between my custom pool Plugins and the task? since they are all running in the server, assume I can cross access namespaces, but not sure how. would prefer to set up queue in and queue out of the backgrounder.

in AppleScript communicated using indigo variables, but that was a real kluge.

David Clonts

Posted on
Thu Dec 27, 2018 11:37 am
jay (support) offline
Site Admin
User avatar
Posts: 15377
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Communicating between Plugin and Background Tasks

So, you envision a separate process that does the low-level communication with the serial port, and then some kind of queueing mechanism to accept requests from any number of plugins? I'm trying to understand the components in your scenario and the architecture. For instance, I'm unclear what you mean by "Running it in Background Tasks" means...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Dec 27, 2018 11:49 am
FlyingDiver online
Posts: 2903
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Communicating between Plugin and Background Tasks

This would be a lot easier if you just wrote it all in one plugin with the serial comm running in it's own thread. Or just poll the serial port in the (existing) background thread. Trying to replicate what you had to do to make it work in AppleScript is going to make it way more complicated.

If it was me, I'd be looking at how the Pentair plugin works. It does serial comm to the pool controller. Or one of the many other plugins that maintain a serial connection to whatever they're controlling. Lutron RRA2, RFPlayer, Concord4 are just the ones I deal with.

joe (aka FlyingDiver)
my plugins:

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests