Skip to content

Instantly share code, notes, and snippets.

@PeteGoo
Created April 18, 2014 04:17
Show Gist options
  • Save PeteGoo/11024613 to your computer and use it in GitHub Desktop.
Save PeteGoo/11024613 to your computer and use it in GitHub Desktop.
Repro for mmbot #126
var robot = Require<Robot>();
var iterations = Enumerable.Range(0,100000);
var random = new Random();
Parallel.ForEach(iterations, i => {
Task.Delay(random.Next(10) * 10).Wait();
var stored = robot.Brain.Get<List<int>>("ints").Result ?? new List<int>();
stored.Add(i);
robot.Brain.Set<List<int>>("ints", stored).Wait();
Console.WriteLine(i);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment