python-engine: Continue execution until there are no more events