You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my app, Users have different "roles" within an Organization. I will want to send some messages to Users/connections of all "roles", while other messages should only be sent to Users/connections with a "role" that's >= to a specific role.
When Users connect, I'm adding them to a room that is a combination of their Organization ID + their role within it, e.g. <orgId>:<role>, e.g. ORG1234:admin.
I have 2 questions:
In this scenario, is there a way to send a message to all Users on an Org, regardless of their role? I would think something like primus.in('ORG1234:*').except(<filter_rooms>).send('update', data) would work, but it does not appear to work. It seems like things work in the opposite direction: a User/connection must join room ORG1234:* and a call like primus.in('ORG1234:admin').except(<filter_rooms>).send('update', data) would reach them. This seems backwards to me. Is this the case or am I missing something?
(This is less expected to work, but along the same vein:) Let's say that I change the string of admin to a value like 1, so in my above example a User would connect to ORG1234:1. Is there a way to send messages to Users/connections that are in <=2 for the "role" part? E.g. primus.in('ORG1234:<=2').except(<filter_rooms>).send('update', data)? Or do I have to create all the room IDs into an array and use them like primus.in(['ORG1234:1', 'ORG1234:2']).except(<filter_rooms>).send('update', data)?
Thanks for any help!
The text was updated successfully, but these errors were encountered:
I will leave this open so that others may find it more easily, but feel free to close if you wish of course. Thank you for this library/package, and for having enough foresight and documentation to make what I wanted to so possible without much difficulty!
In my app, Users have different "roles" within an Organization. I will want to send some messages to Users/connections of all "roles", while other messages should only be sent to Users/connections with a "role" that's >= to a specific role.
When Users connect, I'm adding them to a room that is a combination of their Organization ID + their role within it, e.g.
<orgId>:<role>
, e.g.ORG1234:admin
.I have 2 questions:
In this scenario, is there a way to send a message to all Users on an Org, regardless of their role? I would think something like
primus.in('ORG1234:*').except(<filter_rooms>).send('update', data)
would work, but it does not appear to work. It seems like things work in the opposite direction: a User/connection must join roomORG1234:*
and a call likeprimus.in('ORG1234:admin').except(<filter_rooms>).send('update', data)
would reach them. This seems backwards to me. Is this the case or am I missing something?(This is less expected to work, but along the same vein:) Let's say that I change the string of
admin
to a value like1
, so in my above example a User would connect toORG1234:1
. Is there a way to send messages to Users/connections that are in<=2
for the "role" part? E.g.primus.in('ORG1234:<=2').except(<filter_rooms>).send('update', data)
? Or do I have to create all the room IDs into an array and use them likeprimus.in(['ORG1234:1', 'ORG1234:2']).except(<filter_rooms>).send('update', data)
?Thanks for any help!
The text was updated successfully, but these errors were encountered: