-
Notifications
You must be signed in to change notification settings - Fork 2
Add ZeroMQ pub/sub transport support with explicit import structure #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
@copilot please merge main into this PR |
src/compas_eve/__init__.py
Outdated
"set_default_transport", | ||
"InMemoryTransport", | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all importing of ZeroMQTransport directly into the main __init__
, this should only be an explicit import action by the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all ZeroMQTransport imports from the main init.py. ZeroMQTransport is now only available via explicit import from compas_eve.zeromq
. Commit: 9ea3789
src/compas_eve/zeromq/__init__.py
Outdated
|
||
def __init__(self, endpoint, bind_subscriber=True, *args, **kwargs): | ||
if zmq is None: | ||
raise ImportError("pyzmq is required for ZeroMQ transport. Please install it with: pip install pyzmq") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add conda also to the message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated error message to include conda installation option: "pip install pyzmq or conda install pyzmq". Commit: 9ea3789
tests/integration/test_zeromq.py
Outdated
try: | ||
from compas_eve import ZeroMQTransport | ||
ZEROMQ_AVAILABLE = True | ||
except ImportError: | ||
ZEROMQ_AVAILABLE = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove conditional logic from tests, always test zeromq.
Also, ZeroMQTransport should be importable from compas_eve.zeromq
instead of from compas_eve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all conditional logic from ZeroMQ tests and updated imports to use compas_eve.zeromq
. Tests now always run without skipif decorators. Commit: 9ea3789
@copilot please check the review comment and fix them |
…essage, fix test imports Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
@copilot please merge main back into this PR |
…copilot/fix-18
This PR implements ZeroMQ pub/sub transport for
compas_eve
, providing a high-performance messaging backend that shares the same generic API as existing transports.Implementation
The
ZeroMQTransport
class follows the established patterns fromMqttTransport
andInMemoryTransport
:Transport
andEventEmitterMixin
publish()
,subscribe()
,advertise()
, etc.Usage
Key Features
compas_eve.zeromq
- not auto-imported into main moduleTesting
The implementation allows users to choose the best transport backend for their specific needs while maintaining clean import boundaries and explicit dependency management.
Fixes #18.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.