'Returns the number of slots used at the moment'

@provide_session
def queued_slots(self, session):

    return session.query(TaskInstance).filter((TaskInstance.pool == self.pool)).filter((TaskInstance.state == State.QUEUED)).count()
