Created
July 15, 2020 13:46
-
-
Save tonyroberts/d9122c7ccfca17e3931c48b1d3681529 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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