GeeksDiary / Molecules

Build reliable workflows in .NET
http://geeksdiary.github.io/dependable
12 stars 5 forks source link

StackOverflow when scheduling too many items #2

Open siewfaihoy opened 9 years ago

siewfaihoy commented 9 years ago

In the TestHost, I am using DueSchedule, I made it to dispatch multiple items. When the number is small, e.g. 2000, it was okay. When the number was big, e.g. 30000, it breaks.

We have a requirement to schedule to at least 60000 items.

   public async Task<Activity> DownloadEachItem()
    {
        Console.WriteLine("Download Each Item");
        return Activity.Sequence(CreateItems());
    }

    IEnumerable<Activity> CreateItems(int count = 30000)
    {
        for (var i = 0; i < count; i++)
        {
            var id = i.ToString(); 

            yield return Activity.Sequence(
                Activity.Run<ApplicationDetails>(a => a.Download(id)),
                Activity.Run<ApplicationDetails>(a => a.Convert(id)),
                Activity.Run<ApplicationDetails>(a => a.Notify(id))
                );
        }
    }
buddhike commented 9 years ago

Are you running a debug build?

siewfaihoy commented 9 years ago

It occurs on both modes.