All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.platon.pulsar.protocol.browser.driver.BrowserMonitor.kt Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package ai.platon.pulsar.protocol.browser.driver

import ai.platon.pulsar.common.AppContext
import ai.platon.pulsar.common.concurrent.GracefulScheduledExecutor
import java.time.Duration

open class BrowserMonitor(
    private val browserManager: BrowserManager,
    initialDelay: Long = 30,
    interval: Long = 30
): GracefulScheduledExecutor(Duration.ofSeconds(initialDelay), Duration.ofSeconds(interval)) {
    override fun run() {
        if (!AppContext.isActive) {
            close()
            return
        }

        browserManager.maintain()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy