-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C2s/Do not route broadcast tuples #3946
Conversation
Routing should be done only for stanzas. Arbitrary messages shouldn't be sent this way - they are already sent directly in multiple places.
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportBase: 83.52% // Head: 83.51% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## feature/mongoose_c2s #3946 +/- ##
========================================================
- Coverage 83.52% 83.51% -0.01%
========================================================
Files 538 538
Lines 33965 33944 -21
========================================================
- Hits 28368 28348 -20
+ Misses 5597 5596 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
The events are tagged to encourage meaningful and consistent categories, and prevent evnts like '{item, _, _}' which are hard to debug.
This comment was marked as outdated.
This comment was marked as outdated.
ece7b8d
to
6cad140
Compare
small_tests_24 / small_tests / 6cad140 small_tests_25 / small_tests / 6cad140 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 6cad140 ldap_mnesia_24 / ldap_mnesia / 6cad140 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 6cad140 dynamic_domains_mysql_redis_25 / mysql_redis / 6cad140 pgsql_mnesia_24 / pgsql_mnesia / 6cad140 ldap_mnesia_25 / ldap_mnesia / 6cad140 internal_mnesia_25 / internal_mnesia / 6cad140 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 6cad140 riak_mnesia_24 / riak_mnesia / 6cad140 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 6cad140 pgsql_mnesia_25 / pgsql_mnesia / 6cad140 mysql_redis_25 / mysql_redis / 6cad140 mssql_mnesia_25 / odbc_mssql_mnesia / 6cad140 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely brilliant, love the broadcast being removed, and very good move having the call/cast built into an API with tagged events, better for reading and debugging!
Great job! 🎉
The special
{broadcast, _}
tuples were routed inejabberd_sm
, as if they were XMPP stanzas. This introduced confusion and made the code awkward, while not providing clear benefits. Some arguments, likeFrom
, were made up to fit theroute
function signature. Additionally, thesm_broadcast
hook was misused bymongoose_metrics
- it triggered update of a metric that was presence-specific.Additionally, to avoid more and more expressions like
C2SPid ! SomeTuple
andgen_statem:call(C2sPid, SomeTuple)
, API functions forcall
andcast
are added tomongoose_c2s
.The API function have
EventTag :: atom()
as the second argument. The tag is then passed to theforeign_event
handler. This is to encourage and unify consistent naming of foreign events. The tag is a not mandatory hook arg, because some other events (e.g. timeouts) have their own naming (e.g.{timeout, ?MODULE}
).