title: Map with TTL option in Go
body: <p>I need to build a data-structure like this:</p>
  
  <pre><code>map[string]SomeType 
  </code></pre>
  
  <p>But it must store values for about 10 minutes and then clear it from memory.
  Second condition is records amount - it must be huge. This data-structure must add at least <strong>2-5K records per second</strong>.</p>
  
  <p>So, what is the most correct way in Go to make it?</p>
  
  <p>I'm trying to make goroutine with timeout for each new elemnt. And one(or more) garbage-collector goroutine with channel to receive timeouts and clear elements.
  But I'm not sure it's the most clear way. Is it Ok to have millions of waiting goroutines with timeouts?</p>
  
  <p>Thanks.</p>