mirror of
https://github.com/oxen-io/oxen-pyoxenmq.git
synced 2023-12-13 20:50:34 +01:00
Make Message property accessors copy
The default references, which breaks because Message gets reused, so storing `.conn` gives you something that changes the next time a worker gets a message.
This commit is contained in:
parent
f1160d0a25
commit
4136c29d06
1 changed files with 5 additions and 3 deletions
|
@ -153,11 +153,13 @@ This typically protects administrative commands like shutting down or access to
|
||||||
msg
|
msg
|
||||||
.def_property_readonly("is_reply", [](const Message& m) { return !m.reply_tag.empty(); },
|
.def_property_readonly("is_reply", [](const Message& m) { return !m.reply_tag.empty(); },
|
||||||
"True if this message is expecting a reply (i.e. it was received on a request_command endpoint)")
|
"True if this message is expecting a reply (i.e. it was received on a request_command endpoint)")
|
||||||
.def_readonly("remote", &Message::remote, R"(Some sort of remote address from which the request came.
|
.def_readonly("remote", &Message::remote, py::return_value_policy::copy,
|
||||||
|
R"(Some sort of remote address from which the request came.
|
||||||
|
|
||||||
Typically the IP address string for TCP connections and "localhost:UID:GID:PID" for unix socket IPC connections.)")
|
Typically the IP address string for TCP connections and "localhost:UID:GID:PID" for unix socket IPC connections.)")
|
||||||
.def_readonly("conn", &Message::conn, "The connection ID info for routing a reply")
|
.def_readonly("conn", &Message::conn, py::return_value_policy::copy,
|
||||||
.def_readonly("access", &Message::access,
|
"The connection ID info for routing a reply")
|
||||||
|
.def_readonly("access", &Message::access, py::return_value_policy::copy,
|
||||||
"The access level of the invoker (which can be higher than the access level required for the command category")
|
"The access level of the invoker (which can be higher than the access level required for the command category")
|
||||||
.def("dataview", [](const Message& m) {
|
.def("dataview", [](const Message& m) {
|
||||||
py::list l;
|
py::list l;
|
||||||
|
|
Loading…
Reference in a new issue