Is there a way to write a custom background task/process in Kong?

In Kong, is there a way I can write a (custom) background task that runs as a daemon process? My use case here is that I want to poll a REST endpoint that provides a whitelist of identifiers, and accept/reject the incoming http requests based on what’s in the whitelist (by validating the identifier in the request body against the whitelist).

If my understanding is correct the custom ‘plugins’ will only get invoked by Kong upon receiving a request to the endpoint the plugin is attached to. Therefore I presume I cannot write a plugin to do what I want to achieve. Please correct me if my understand is wrong.

I’m new to Kong so any guidance would be highly appreciated.