def notify_ready(self, apply_result):
        got_first = False
        got_last = False
        self._lock.acquire()
        try:
            assert self._remaining > 0
            got_first = (len(self._results) == self._remaining)
            self._remaining -= 1
            got_last = (self._remaining == 0)
        finally:
            self._lock.release()

        if self._to_notify is not None:
            if self._as_iterator and got_first:
                self._to_notify._set_value(iter(self))
            elif not self._as_iterator and got_last:
                try:
                    lst = [r.get(0) for r in self._results]
                except:
                    self._to_notify._set_exception()
                else:
                    self._to_notify._set_value(lst)
L{SSHChannel} instances provide L{interfaces.ITransport}.
dataset/ETHPy150Open serverdensity/sd-agent/checks/libs/thread_pool.py/OrderedResultCollector.notify_ready--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/conch/test/test_channel.py/ChannelTests.test_interface