예제 #1
0
    private async static void StartCreatingTrees()
    {
        var    producer = messagingFactory.CreateProducer <Tree>();
        Random random   = new Random();

        while (true)
        {
            var newTree = new Tree();
            Console.WriteLine(newTree + " created.");
            producer.SendMessage("tree-created", newTree);
            await Task.Delay(random.Next(1500, 5000));
        }
    }
예제 #2
0
    private async static void StartCreatingMonkeys()
    {
        var producer = messagingFactory.CreateProducer <Monkey>();

        while (true)
        {
            var newMonkey = new Monkey();
            Console.WriteLine(newMonkey + " created.");
            producer.SendMessage("monkey-created", newMonkey);
            await Task.Delay(1500);
        }
    }