mirror of
https://github.com/oxen-io/oxen-pyoxenmq.git
synced 2023-12-13 20:50:34 +01:00
Remove duplicate method
Not sure why this was here, but AFAICT it is identical to `add_request_command` without the `_ex`.
This commit is contained in:
parent
2805d01f6b
commit
959df9c5dd
1 changed files with 0 additions and 31 deletions
|
@ -178,37 +178,6 @@ namespace oxenmq
|
||||||
msg.send_reply(result);
|
msg.send_reply(result);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.def("add_request_command_ex",
|
|
||||||
[](OxenMQ &self,
|
|
||||||
std::string category,
|
|
||||||
std::string name,
|
|
||||||
py::function handler)
|
|
||||||
{
|
|
||||||
self.add_request_command(category, name,
|
|
||||||
[handler](Message & msg) {
|
|
||||||
std::string result;
|
|
||||||
{
|
|
||||||
py::gil_scoped_acquire gil;
|
|
||||||
|
|
||||||
std::vector<py::bytes> data;
|
|
||||||
for (auto& arg : msg.data)
|
|
||||||
{
|
|
||||||
data.emplace_back(arg.begin(), arg.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const auto obj = handler(data, msg);
|
|
||||||
result = py::str(obj);
|
|
||||||
}
|
|
||||||
catch(std::exception & ex)
|
|
||||||
{
|
|
||||||
PyErr_SetString(PyExc_RuntimeError, ex.what());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
msg.send_reply(result);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.def("connect_remote",
|
.def("connect_remote",
|
||||||
[](OxenMQ & self,
|
[](OxenMQ & self,
|
||||||
std::string remote) -> ConnectionID
|
std::string remote) -> ConnectionID
|
||||||
|
|
Loading…
Reference in a new issue