def collect_placement(self, it, app):
        _log.analyze(self._node.id, "+ BEGIN", {}, tb=True)
        if app._collect_placement_cb:
            app._collect_placement_cb.cancel()
            app._collect_placement_cb = None
        try:
            while True:
                _log.analyze(self._node.id, "+ ITER", {})
                actor_node_id = it.next()
                app._collect_placement_last_value = app._collect_placement_counter
                app.actor_placement.setdefault(actor_node_id[0], set([])).add(actor_node_id[1])
        except dynops.PauseIteration:
            _log.analyze(self._node.id, "+ PAUSED",
                    {'counter': app._collect_placement_counter,
                     'last_value': app._collect_placement_last_value,
                     'diff': app._collect_placement_counter - app._collect_placement_last_value})
            # FIXME the dynops should be self triggering, but is not...
            # This is a temporary fix by keep trying
            delay = 0.0 if app._collect_placement_counter > app._collect_placement_last_value + 100 else 0.2
            app._collect_placement_counter += 1
            app._collect_placement_cb = async.DelayedCall(delay, self.collect_placement, it=it,
                                                                    app=app)
            return
        except __HOLE__:
            if not app.done_final:
                app.done_final = True
                # all possible actor placements derived
                _log.analyze(self._node.id, "+ ALL", {})
                self._app_requirements(app)
                _log.analyze(self._node.id, "+ END", {})
        except:
            _log.exception("appmanager:collect_placement")

    ### DEPLOYMENT ###
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/appmanager.py/AppManager.collect_placement