parameters: (self, request: CommandCreate)
return_statement: return self._state_store.commands.get(command.id)
docstring: Add a command to the queue and wait for it to complete.
  
          The engine must be started by calling `play` before the command will
          execute. You only need to call `play` once.
  
          Arguments:
              request: The command type and payload data used to construct
                  the command in state.
  
          Returns:
              The completed command, whether it succeeded or failed.
docstring_summary: Add a command to the queue and wait for it to complete.
docstring_tokens: Add a command to the queue and wait for it to complete .
function: async def add_and_execute_command(self, request: CommandCreate) -> Command:
          """Add a command to the queue and wait for it to complete.
  
          The engine must be started by calling `play` before the command will
          execute. You only need to call `play` once.
  
          Arguments:
              request: The command type and payload data used to construct
                  the command in state.
  
          Returns:
              The completed command, whether it succeeded or failed.
          """
          command = self.add_command(request)
          await self._state_store.wait_for(
              condition=self._state_store.commands.get_is_complete,
              command_id=command.id,
          )
          return self._state_store.commands.get(command.id)
function_tokens: async def add_and_execute_command ( self , request : CommandCreate ) -> Command : command = self . add_command ( request ) await self . _state_store . wait_for ( condition = self . _state_store . commands . get_is_complete , command_id = command . id , ) return self . _state_store . commands . get ( command . id )