How to communicate between Plugin and Background Task

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

How to communicate between Plugin and Background Task

I've set up plugin relay devices for my pool. I've had an AppleScript running in Background Tasks that handles the serial communication. Rewriting in Python.

the question: what is best way to communicate between the plugin and the background task and its threads. really want queues both in and out of the task.

since all running in server, assume there is a way to talk between the namespaces, but not sure how. in applescript, used a bunch of Indigo variables, but that is a real kluge. Would look like this:

Plugin <--------> background task to process commands at low level <---------------> thread sending/receiving commands with pyserial
??? Queue

Its that first link that is getting me. would prefer queues or a priority queue.

David Clonts

Posted on
Tue Dec 25, 2018 10:53 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: How to communicate between Plugin and Background Task

Is this a custom plugin of your own or something from the plugin store? If it’s your own, run the background thread in the plugin.



Sent from my iPhone using Tapatalk

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Dec 25, 2018 12:22 pm
dclonts offline
Posts: 49
Joined: Nov 05, 2006

Re: How to communicate between Plugin and Background Task

Yeah, my own.

Not bad solution. But problem is I will have multiple custom plugins for the pool. Thermostat separate from a bunch of switches.

I've thought about setting up socket or something like that, but seems like overkill. Should be able to do it with non-blocking threads.

David Clonts

Posted on
Tue Dec 25, 2018 4:24 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: How to communicate between Plugin and Background Task

You can do direct plugin to plugin communication
Very simple to setup and works fine. Have no problems. Connected 3 plugins to a receiving plugin.


Checkout the how to wiki page


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron