code: async def execute_command(self, command):
          
          self.apply_future = asyncio.Future(loop=self.loop)
  
          entry = self.log.write(self.storage.term, command)
          asyncio.ensure_future(self.append_entries(), loop=self.loop)
  
          await self.apply_future
docs: Write to log & send AppendEntries RPC