def _max_in_flight_semaphore()

in src/azstoragetorch/_client.py [0:0]


    def _max_in_flight_semaphore(self) -> threading.Semaphore:
        # The standard thread pool executor does not bound the number of tasks submitted to it.
        # This semaphore introduces bound so that the number of submitted, in-progress
        # futures are not greater than the available workers. This is important for cases where we
        # buffer data into memory for uploads as is prevents large amounts of memory from being
        # submitted to the executor when there are no workers available to upload it.
        return threading.Semaphore(self._max_in_flight_requests)