diff --git a/src/zeroros/publisher.py b/src/zeroros/publisher.py index 81b3577..3bb198c 100644 --- a/src/zeroros/publisher.py +++ b/src/zeroros/publisher.py @@ -1,5 +1,7 @@ +import asyncio import json import time +import sys import zmq @@ -7,6 +9,10 @@ from zeroros.topic import validate_topic +if sys.platform == 'win32': + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + + class Publisher: def __init__( self, diff --git a/src/zeroros/subscriber.py b/src/zeroros/subscriber.py index 8f78f85..0c3a8f7 100644 --- a/src/zeroros/subscriber.py +++ b/src/zeroros/subscriber.py @@ -2,6 +2,7 @@ import json import threading import time +import sys import zmq import zmq.asyncio @@ -10,6 +11,10 @@ from zeroros.topic import validate_topic +if sys.platform == 'win32': + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + + class Subscriber: def __init__( self,