@provide_session
    def queued_slots(self, session):
        return (
            session
            .query(TaskInstance)
            .filter(TaskInstance.pool == self.pool)
            .filter(TaskInstance.state == State.QUEUED)
            .count()
        )
Returns the number of slots used at the moment
dataset/ETHPy150Open airbnb/airflow/airflow/models.py/Pool.queued_slots