title: Collecting values from events
body: <p>I have an event.
  The event is fired from time to time and it calls an Event Handler that is an <code>Action&lt;int&gt;</code>.</p>
  
  <p>Now I want to "collect" these integers the event is delivering me and save them in lists. I also want to specify the moment when a list is completed and a new list is started.</p>
  
  <p>The naive solution I was thinking of is a property <code>List&lt;int&gt; ValList</code>. 
  The Event Handler is adding a value everytime it is called.
  The consumer side is taking the list when it wants to and will say from time to time <code>ValList = new List&lt;int&gt;();</code>
  To avoid problems with thread synchronization I will need a lock, too.</p>
  
  <p>I find this solution so terribly ugly and was wondering of alternatives.
  With time I became more and more a functional programmer and I am using it very often.
  But when it comes to problems like this I am still thinking to procedural.
  I'd really like to avoid a mutable list (I am still using System.Collections.Immutable).</p>
  
  <p>Is there a nice functional solution without mutables and side effects?</p>