private static CalculateOverlapsResponse CalculateOverlapsRpc(
            RemoveOverlapsGrpc.RemoveOverlapsGrpcClient rpcClient,
            IList <Feature> selectedFeatures,
            IList <Feature> overlappingFeatures,
            CancellationToken cancellationToken)
        {
            CalculateOverlapsRequest request =
                CreateCalculateOverlapsRequest(selectedFeatures, overlappingFeatures);

            CalculateOverlapsResponse response;

            try
            {
                response = rpcClient.CalculateOverlaps(request, null, null,
                                                       cancellationToken);
            }
            catch (Exception e)
            {
                _msg.Debug($"Error calling remote procedure: {e.Message} ", e);

                throw;
            }

            return(response);
        }
        private static CalculateOverlapsResponse CalculateOverlapsRpc(
            RemoveOverlapsGrpc.RemoveOverlapsGrpcClient rpcClient,
            IList <Feature> selectedFeatures,
            IList <Feature> overlappingFeatures,
            CancellationToken cancellationToken)
        {
            CalculateOverlapsRequest request =
                CreateCalculateOverlapsRequest(selectedFeatures, overlappingFeatures);

            int maxTimePerFeature = 4000;

            CalculateOverlapsResponse response =
                RpcCallUtils.Try(
                    o => rpcClient.CalculateOverlaps(request, o),
                    cancellationToken, maxTimePerFeature * selectedFeatures.Count);

            return(response);
        }