示例#1
0
        public void CreateAndDestroy()
        {
            GrpcEnvironment.AddRef();
            var cq = CompletionQueueSafeHandle.Create();

            cq.Dispose();
            GrpcEnvironment.ReleaseAsync().Wait();
        }
示例#2
0
 public void CompletionQueueCreateDestroyBenchmark()
 {
     BenchmarkUtil.RunBenchmark(
         100000, 1000000,
         () => {
         CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create();
         cq.Dispose();
     }
         );
 }
        public void CreateAndShutdown()
        {
            var cq = CompletionQueueSafeHandle.Create();

            cq.Shutdown();
            var ev = cq.Next();

            cq.Dispose();
            Assert.AreEqual(GRPCCompletionType.Shutdown, ev.type);
            Assert.AreNotEqual(IntPtr.Zero, ev.success);
            Assert.AreEqual(IntPtr.Zero, ev.tag);
        }
示例#4
0
        public void CompletionQueueCreateDestroyBenchmark()
        {
            GrpcEnvironment.AddRef();  // completion queue requires gRPC environment being initialized.

            BenchmarkUtil.RunBenchmark(
                10, 10,
                () =>
            {
                CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create();
                cq.Dispose();
            });

            GrpcEnvironment.ReleaseAsync().Wait();
        }
示例#5
0
        public void CreateAndShutdown()
        {
            GrpcEnvironment.AddRef();
            var cq = CompletionQueueSafeHandle.Create();

            cq.Shutdown();
            var ev = cq.Next();

            cq.Dispose();
            GrpcEnvironment.ReleaseAsync().Wait();
            Assert.AreEqual(CompletionQueueEvent.CompletionType.Shutdown, ev.type);
            Assert.AreNotEqual(IntPtr.Zero, ev.success);
            Assert.AreEqual(IntPtr.Zero, ev.tag);
        }
        public void CreateAndDestroy()
        {
            var cq = CompletionQueueSafeHandle.Create();

            cq.Dispose();
        }