In [6]: ss = ep.make_status_subscriber(True)
In [7]: ss.get(0.5)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
TypeError: Unregistered type : std::optional<std::variant<broker::none, broker::error, broker::status> >
The above exception was the direct cause of the following exception:
TypeError Traceback (most recent call last)
<ipython-input-7-4fcab5cf726a> in <module>
----> 1 ss.get(0.1)
/opt/zeek-dev-prod/lib/zeek/python/broker/__init__.py in get(self, *args, **kwargs)
208
209 def get(self, *args, **kwargs):
--> 210 x = self._subscriber.get(*args, **kwargs)
211 return self._to_result(x)
212
TypeError: Unable to convert function return value to a Python type! The signature was
(self: broker._broker.StatusSubscriber, arg0: float) -> std::optional<std::variant<broker::none, broker::error, broker::status> >
Did you forget to `#include <pybind11/stl.h>`? Or <pybind11/complex.h>,
<pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic
conversions are optional and require extra headers to be included
when compiling your pybind11 module.
In [13]: ss = ep.make_subscriber("/topic/test")
In [14]: r = ss.get(0.5)
In [15]: print(repr(r))
None
Using
.get()providing a timeout on aStatusSubscribercauses TypeError splash:This works fine with a normal subscriber with a 0.5 second delay: