public void CreateAndDestroy() { GrpcEnvironment.AddRef(); var cq = CompletionQueueSafeHandle.Create(); cq.Dispose(); GrpcEnvironment.ReleaseAsync().Wait(); }
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); }
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(); }
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(); }