appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.19k stars 755 forks source link

chore: Perform listeners cleanup periodically #2077

Closed mykola-mokhnach closed 8 months ago

mykola-mokhnach commented 8 months ago

Change list

Listeners are cleaned up lazily, e.g. every time getListeners API is called we also remove garbage-collected items. Although, due to an unpredictable nature of the garbage collector and no guarantees about the frequency of getListeners API calls we schedule the below loop to be executed every minute, and make sure there are no extra references to obsolete listeners

Types of changes