コード例 #1
0
ファイル: MessageQueueTests.cs プロジェクト: iennacca/lhotse
        public void CanCreateMessageQueueUsingNNPrimitives()
        {
            var cancelSource = new CancellationTokenSource();

            Debug.WriteLine("Executing ReqRep test");

            var responseThread = new Thread(() => NNPrimitivesRequestReplyProcesses.Response(cancelSource.Token));

            responseThread.Start();
            NNPrimitivesRequestReplyProcesses.Request();
            cancelSource.Cancel();
        }
コード例 #2
0
ファイル: MessageQueueTests.cs プロジェクト: iennacca/lhotse
        public void CanDoSuccessiveRequestReplies()
        {
            var cancelSource = new CancellationTokenSource();

            Debug.WriteLine("Executing ReqRep test");

            var responseThread = new Thread(() => NNPrimitivesRequestReplyProcesses.Response(cancelSource.Token));

            responseThread.Start();
            Assert.IsTrue(responseThread.IsAlive);
            NNPrimitivesRequestReplyProcesses.Request();
            Debug.WriteLine(String.Empty);
            Assert.IsTrue(responseThread.IsAlive);
            NNPrimitivesRequestReplyProcesses.Request();
            cancelSource.Cancel();
        }