code: def simulate_async_event():
      
      scc.state = 'executing'
      def async_event(result):
          """All other asynchronous events or function calls
          returned from later steps will wait until this
          callback fires."""
          scc.state = result
          return 'some event result'
      deferred = Deferred()
      reactor.callLater(1, deferred.callback, 'done') # pylint: disable=E1101
      deferred.addCallback(async_event)
      return deferred
docs: Simulate an asynchronous event.