broker
broker copied to clipboard
Status subscriber timeout doesn't work in Python
Consider this example:
#!/usr/bin/env python
import broker
endpoint = broker.Endpoint()
status_subscriber = endpoint.make_status_subscriber(True)
msg = status_subscriber.get(0.5)
The output:
Traceback (most recent call last):
File "test.py", line 7, in <module>
msg = status_subscriber.get(0.5)
File ".../env/lib/python/broker/__init__.py", line 128, in get
x = self._subscriber.get(*args, **kwargs)
TypeError: Unable to convert function return value to a Python type! The signature was
(self: broker._broker.StatusSubscriberBase, arg0: float) -> caf::optional<caf::variant<broker::none, caf::error, broker::status> >
It looks like we need to dispatch the variant to different Python types.
Thanks, would you be able to create a PR that fixes it?
Note that you should currently be able to get equivalent behavior to what you want via:
msg = status_subscriber.get(1, 0.5)
Thanks, would you be able to create a PR that fixes it?
Yeah, but unfortunately I'm quite pressed on cycles before BroCon. I put it on my todo list for afterwards.
@mavam I believe the status subscriber has actually been re-implemented since then. Does this still happen?