Example #1
0
        static void Main()
        {
            IDocumentManager <Document> documentManager = new TsDocumentManager(new DocumentManager());

            ProcessDocuments.Start(documentManager);

            // Создать документы и добавить их в DocumentManager
            for (int i = 0; i < 1000; i++)
            {
                var document = new Document(string.Format("Doc {0}", i), "content");
                documentManager.AddDocument(document);
                Console.WriteLine("Added document {0}", document.Title);
                Thread.Yield();
            }

            Console.ReadLine();
        }
        static void Main()
        {
            var dm = new DocumentManager();

            ProcessDocuments.StartAsync(dm);

            // Create documents and add them to the DocumentManager
            for (int i = 0; i < 1000; i++)
            {
                Document doc = new Document("Doc " + i.ToString(), "content");
                dm.AddDocument(doc);
                WriteLine("Added document {0}", doc.Title);
                Task.Delay(new Random().Next(20)).Wait();
            }

            ReadLine();
        }
Example #3
0
        static void Main()
        {
            var dm = new DocumentManager();

            ProcessDocuments.StartAsync(dm);

            // Create documents and add them to the DocumentManager
            for (int i = 0; i < 1000; i++)
            {
                Document doc = new Document($"Doc {i}", "content");
                dm.AddDocument(doc);
                Console.WriteLine($"Added document {doc.Title}");
                Task.Delay(new Random().Next(20)).Wait();
            }

            Console.ReadLine();
        }
Example #4
0
        static async Task Main()
        {
            var documentManager = new DocumentManager();

            Task processDocuments = ProcessDocuments.Start(documentManager);

            for (int i = 0; i < 100; i++)
            {
                var doc = new Document($"Doc {i}", "content");
                documentManager.AddDocument(doc);
                Console.WriteLine($"Added document {doc.Title}");
                await Task.Delay(new Random().Next(20));
            }

            await processDocuments;

            Console.ReadLine();
        }