[jboss-jira] [JBoss JIRA] (DROOLS-2967) Immutable callback model as apposed to mutable listeners
Mark Proctor (JIRA)
issues at jboss.org
Tue Sep 4 13:40:00 EDT 2018
[ https://issues.jboss.org/browse/DROOLS-2967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13628670#comment-13628670 ]
Mark Proctor commented on DROOLS-2967:
--------------------------------------
We should transition KIE to using single method callbacks, instead of lists of listeners.
If the user wishes to use a list os listeners they can use an adapter. In effect this would be like moving the current EventSupport class as an external library for end users.
All callbacks must be set a instantiation time and are not mutable. If the users wishes to mutate, or have a list of listeners, they can do that in their adapter.
This way we push thread handling out to the user, and see Kie work "bare metal". It will remove complicated code, that assumes the most pessimistic use cases for multi-threading - especially as it's rate those listeners change, so why incur the cost?
Further a callback approach passes all objects as arguments, instead of create an Event wrapper object. For light weight stream analysis, we want to minimise he GC impact - so every object less, helps. Again if the user wants a listener model, with Event object, this can be done in the adapter.
We can provide base adapters for the users, they can also write their own.
> Immutable callback model as apposed to mutable listeners
> --------------------------------------------------------
>
> Key: DROOLS-2967
> URL: https://issues.jboss.org/browse/DROOLS-2967
> Project: Drools
> Issue Type: Feature Request
> Reporter: Mark Proctor
> Assignee: Mario Fusco
> Labels: MDP_BRAINFARTS
>
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list