Created
April 18, 2014 04:17
-
-
Save PeteGoo/11024613 to your computer and use it in GitHub Desktop.
Repro for mmbot #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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