Skip to content

Instantly share code, notes, and snippets.

@tonyroberts
Created July 15, 2020 13:46
Show Gist options
  • Save tonyroberts/d9122c7ccfca17e3931c48b1d3681529 to your computer and use it in GitHub Desktop.
Save tonyroberts/d9122c7ccfca17e3931c48b1d3681529 to your computer and use it in GitHub Desktop.
from pyxll import RTD
import pubsub
class SubscriberRTD(RTD):
def __init__(self, topic):
super().__init__(value="Waiting...")
self.__topic = topic
def connect(self):
pubsub.subscribe(self.__topic, self.__callback)
def disconnect(self):
pubsub.unsubscribe(self.__topic, self.__callback)
def __callback(self, value):
self.value = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment