async def helper0(self):
self.counter += 1
if self.counter == 1:
await execute(activity-foo)
else:
await execute(activity-bar)
async def helper1(self):
self.counter += 1
if self.counter == 1:
await execute(activity-abc)
else:
await execute(activity-xyz)
await asyncio.gather(helper0(), helper1())
Since asyncio.gather doesn’t guarantee the invocation order (only that returned result will be ordered as given), different runs can see different values of self.counter depending on whether helper0 was scheduled 1st or helper1.
Will temporal have a problem with this? Or does it do some magic behind the scenes to tackle this (eg. by monkey patching asyncio.gather to their own version etc)?