-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[idea] Support of delivery filters for MPSC mboxes? #40
Comments
An obvious solution is support for delivery_filters with a format: bool filter(so_5::mutable_msg<T> msg);
// and, for symmetry
bool filter(so_5::immutable_msg<T> msg); But the problem is that |
Another solution is addition of some flag to so_set_delivery_filter(so_5::message_mutability_t::mutable_message,
[](const my_message & msg) { return msg.m_some_value < 10; }); |
Another solution is addition of a new method: so_set_delivery_filter_for_mutable_msg(mbox,
[](const my_message & msg) { return msg.m_some_value < 10; }); |
Is available now in v.5.7.4. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
The current version of SObjectizer prohibits the usage of delivery filters with MPSC mboxes. The root of this ban is somewhere in the past. MPSC mboxes were created as an optimization trick to speed up message exchange in 1-to-1 scenarios. Mutable messages and the role of MPSC mboxes for mutable messages were discovered much later.
There is no big sense in support for delivery filters for standard MPSC mboxes (available via
agent_t::so_direct_mbox()
). But there can be some forms of custom MPSC mboxes (like unique-subscribers mboxes from upcoming so5extra-1.5), and the support for delivery filters for those custom mboxes could be crucial.The problem is that the current version of SObjectizer doesn't provide a way to specify a delivery filter for a mutable message. Message mutability isn't supported by
agent_t::so_set_delivery_filter
methods.The text was updated successfully, but these errors were encountered: