Exemplo n.º 1
0
        public virtual void Delete(GrpcConnection connection, GrpcSbFrame grpcSbFrame)
        {
            var client = new RemoteFrameRpcService.RemoteFrameRpcServiceClient(
                connection.CallInvoker);

            connection
            .GetOrCreateBulkDeleter <GrpcSbFrame>()
            .QueueForDeletion(grpcSbFrame, (List <GrpcSbFrame> frames) =>
            {
                var request = new BulkDeleteRequest();
                request.Frames.AddRange(frames);
                connection.InvokeRpc(() =>
                {
                    client.BulkDelete(request);
                });
            });
        }
Exemplo n.º 2
0
 // Disposing indicates whether this method has been called by user's code or by the
 // the destructor. In the latter case, we should not reference managed objects as we cannot
 // know if they have already been reclaimed by the garbage collector.
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         // We only have unmanaged resources to dispose of in this class.
         connection
         .GetOrCreateBulkDeleter <GrpcSbFrame>()
         .QueueForDeletion(grpcSbFrame, (List <GrpcSbFrame> frames) =>
         {
             var request = new BulkDeleteRequest();
             request.Frames.AddRange(frames);
             connection.InvokeRpc(() =>
             {
                 client.BulkDelete(request);
             });
         });
         gcHandle.Free();
         disposed = true;
     }
 }