For a newbie (I'm just going through the Tropical guide "Waiting for another process to terminate"), I imagined yield self.env.process(Timeout(self.env, delay)) and yield self.env.timeout(delay) is equivalent expression, where the latter is a short form of the former, because both expression have the same meaning to register the Timeout event with the environment, and get triggered a later time.
But former complains ValueError: <Timeout(29) object at 0x2997fa2fd08> is not a generator..
The generator in the error indicates, there's something technical going on, could you please shed some light on what is the difference of these two forms? And how to make the former work (that is to use Timeout directly) if desired to for testing purpose?
For a newbie (I'm just going through the Tropical guide "Waiting for another process to terminate"), I imagined
yield self.env.process(Timeout(self.env, delay))
andyield self.env.timeout(delay)
is equivalent expression, where the latter is a short form of the former, because both expression have the same meaning to register the Timeout event with the environment, and get triggered a later time.But former complains
ValueError: <Timeout(29) object at 0x2997fa2fd08> is not a generator.
.The generator in the error indicates, there's something technical going on, could you please shed some light on what is the difference of these two forms? And how to make the former work (that is to use
Timeout
directly) if desired to for testing purpose?