title: How to interrupt nested processes in SimPy?
body: <p>I'm trying to interrupt a set of nested processes in simpy. It appears from the following code that only the first layer of processes is interrupted by an interrupt event, and I can't seem to find a way to reference the processes defined within another process from outside the outer process in order to interrupt them. Below is a minimum reproducible example:</p>
  
  <pre><code>import simpy
  
  env = simpy.Environment()
  
  def process_one():
      try:
          yield env.timeout(5)
          print("inside process one")
          yield env.process(process_two())
          yield env.timeout(10)
      except simpy.Interrupt:
          print("interrupted at ", env.now)
  
  def process_two():
      try:
          yield env.timeout(5)
          print("inside process two")
          yield env.timeout(5)
          print("finishing process two")
      except simpy.Interrupt:
          print("process two interrupted at", env.now)
  
  process = env.process(process_one())
  
  
  def interruption(time):
      yield env.timeout(time)
      process.interrupt()
  
  env.process(interruption(6))
  
  env.run(until=30)
  </code></pre>
  
  <p>Process one gets interrupted as it should, but process two continues on its business. If I assign <code>env.process(process_two)</code> to a variable inside <code>process_one</code>, I can't access it from outside the scope of <code>process_one</code>. Is there a way to cause an interruption to interrupt all ongoing processes defined within a parent process, or do all processes in simpy have to be defined only one layer deep?</p>