title: Async iterator ticking at a regular interval
body: <p>I am implementing an asynchronous iterator to be used with <code>async for</code> which should return a new value at a (mostly) regular interval.</p>
  
  <p>We can illustrate such iterator with a simple clock that will increment a counter every ~n seconds:</p>
  
  <pre><code>import asyncio
  
  class Clock(object):
      def __init__(self, interval=1):
          self.counter = 0
          self.interval = interval
          self.tick = asyncio.Event()
          asyncio.ensure_future(self.tick_tock())
  
      async def tick_tock(self):
          while True:
              self.tick.clear()
              await asyncio.sleep(self.interval)
              self.counter = self.__next__()
              self.tick.set()
  
      def __next__(self):
          self.counter += 1
          return self.counter
  
      def __aiter__(self):
          return self
  
      async def __anext__(self):
          await self.tick.wait()
          return self.counter
  </code></pre>
  
  <p>Is there a better or cleaner approach than using <code>asyncio.Event</code>? More than one coroutine will <code>async for</code> on this iterator.</p>