Hi, I'm trying to figure out how to use sipyco.sync_struct to keep objects in sync, but I'm not sure exactly how.
Here is by code for the publisher:
f = Notifier([100])
server_notify = Publisher({"freq": f})`
loop = asyncio.new_event_loop()
loop.run_until_complete(server_notify.start("::1", 2024))
And here is my code for the receiver or subscriber
class Hello():
def sub_init(self, data):
self.frequency = data
print(data)
return data
def subscribe(self):
self.subscriber = Subscriber("freq", self.sub_init)
def main():
loop = asyncio.new_event_loop()
h = Hello()
h.subscribe()
loop.run_until_complete(h.subscriber.connect("::1", 2024))
When I try run the publisher, I get a 'task was destroyed but is pending'. I think the loop.run_until_complete is the problem, but I'm not sure what to replace it with (run forever can't accept an argument). I was inspired by the artiq_master.py file.
I see that https://forum.m-labs.hk/d/819-subscribing-to-datasets-outside-of-the-artiq-environment has covered how to make the subscriber portion work, but I am not sure about the publisher portion.