Zend certified PHP/Magento developer

Magento2 admin page keeps loading during the execution of the function used in a controller

Basically. I’ve created a button in M2 admin. Clicking on that button runs my custom created indexer.

The indexer is fetching all the products and send them to a third party service with a POST request.

Now, the problem is ‘clicking on the button is syncing the products. But, during the process the admin page keeps loading until the process is completed’.The process is taking time (2-3 mins).

So, Is there any method that can help me to run the sync process in the background and stop the page from continuous loading ?

Thank you in advance !