Dependency Inversion

video locked
Enroll to watch

8 mins

In this video, Gaurav Sen discusses the sliding window object that requires a service configuration to work, and the service configuration requires an API call to hit the server.

One way to make an API call inside the Constructor is to use a rate limiter that helps to make the API call inside the Constructor itself.

This will require a server IP address to be hit, which is known by using the service config already set up in the rate limiter server.

There are two ways to handle this problem - one is to use a blocking call, and the other is to expect that the service config will be sent beforehand.

He also discusses creating a separate pool of threads for the rate limiter server to avoid blocking threads.