Question about aspect filtering & dispatch #316
-
I have a working request message handler system that dispatches incoming requests to an appropriate handler. A few bytes at the start of the data define a msgType to control this. I suspect that is what the aspect filtering was designed to help with. What I'm not sure of is how to use aspects to accomplish this. Is it simply a matter of registering multiple handlers with different "paths", or does it require different destinations, each with a unique aspect filter? If that is the intended design pattern I failed to grasp it, hence why I used the single destination approach I did. I don't find it intuitive to think of destinations in that way. I see them as synonymous to entity, not function. RNS is a new animal and I'm just getting familiar with it, so I'll admit the approach I've taken may not be optimal. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
No. Aspect filtering in the announce-handling mechanisms are there to allow your application to only receive announce notifications about the destination types it cares about.
This is probably inefficient. You may want to just use different request paths to do this. Also, remember that Reticulum can send and receive arbitrary data structures directly in You don't have to do binary encoding yourself, and in almost all cases, it will be more efficient to let Reticulum handle this, since it takes into account optimal packing and compression, across the entire data stream. You can do this: request_data = {
"cmd": "do_math",
"operation": "sum",
"numbers": [2, 3, 5, 7, 11]
}
established_link.request("/my_dynamic_handler", data=request_data, response_callback=my_callback) And your request handler in the other end will receive that exact data structure. No need to do any packing or unpacking yourself. |
Beta Was this translation helpful? Give feedback.
-
One of IP's fatal flaw was this mixup, known as the "loc/id split." An IP address is overloaded by both locating and identifying entities. RNS employs destinations as purposeful addresses an entity presents in a one-to-many relationship. |
Beta Was this translation helpful? Give feedback.
No. Aspect filtering in the announce-handling mechanisms are there to allow your application to only receive announce notifications about the destination types it cares about.
This is probably inefficient. You may want to just use different request paths to do this.
Also, remember that Reticulum can send and receive arbitrary data structures directly in
Requests
andResponses
.You don't have to do binary encoding yourself, and in almost all cases, it will be more efficient to let Reticulum handle this, since it takes into account optimal packing…