oxen-io / oxen-mq

Communications layer used for both the Oxen storage server and oxend
https://oxen.io
BSD 3-Clause "New" or "Revised" License
19 stars 35 forks source link

add operator() for defered message replying #47

Closed majestrate closed 2 years ago

majestrate commented 2 years ago

add something like:

auto reply = msg.defer_reply(reply_type::whatever);
reply(some_Junk_or_stuff);
jagerman commented 2 years ago

I think we could actually just add the operator() to DeferredSend without needing a new method/subclass/etc.: if reply_tag is set then the incoming message was a reply and it can forward arguments to reply(); otherwise it was a 1-way message and operator() can forward to back(). (And if you need to defer a full request, or something else exotic you can still use the named methods).