oxen-mq icon indicating copy to clipboard operation
oxen-mq copied to clipboard

feature request: Connection ID groups

Open majestrate opened this issue 3 years ago • 2 comments

oxend rpc code, pysogs and many other code bases would greatly benefit from adding / removing connection ids into a group and being able to send to the group and everyone in the group gets that message sent to them.

Something akin to:

struct BuddyGroup
{
    std::unordered_set<ConnectionID> _buddies;
    
    void add(ConnectionID);
    void remove(ConnectionID);
    
    template<typename Args>
    void send(Args && ...) const; // blah blah blah send to all the buddies
};

majestrate avatar Nov 18 '21 17:11 majestrate

I think it would be simpler for the API to just be able to pass an unordered_set of ConnectionIDs as the first argument to omq.send(...) -- no need to store an (invalidatable) reference to the OxenMQ, and no need to wrap the unordered_set capabilities.

jagerman avatar Nov 19 '21 15:11 jagerman

true.

majestrate avatar Nov 19 '21 15:11 majestrate