glimmerveen commented on code in PR #486:
URL: https://github.com/apache/felix-dev/pull/486#discussion_r2984381875


##########
scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java:
##########
@@ -718,42 +716,44 @@ public Dictionary<String, Object> 
getServiceRegistrationProperties()
 
     public void setRegistration(final 
ServiceRegistration<ServiceComponentRuntime> reg)
     {
-        this.registration = reg;
+        long delay = m_configuration.serviceChangecountTimeout();
+        m_componentActor.scheduleWithFixedDelay(new 
UpdateChangeCountProperty(reg), delay, delay, TimeUnit.MILLISECONDS);

Review Comment:
   Thanks for this update! What I like about this new approach is that in my 
use case the timeout period guarantees my observer to be notified within the 
timeout at the latest, while before a continues stream of updates could result 
in the observer eventually being notified way later than the configured 
timeout, which could before only be "mitigated" by using a very small timeout.
   
   I perhaps would consider changing the cancelling logic from a counter 
towards using time, which is update at schedule and evaluated during task 
execution (current time > last schedule time + some delta). Where the delta 
itself could be configurable as well. I would find that representation of the 
logic a bit more readable I guess, but that is of course also some personal 
preference perhaps!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to