Skip to content

Commit

Permalink
Internaize utility classes, remove unused ones. (microsoft#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher authored May 14, 2020
1 parent 20d5097 commit 1d8a868
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 349 deletions.
29 changes: 0 additions & 29 deletions src/ReverseProxy/Abstractions/Time/IWallClockTimer.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/ReverseProxy/EventIds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.ReverseProxy
{
public static class EventIds
internal static class EventIds
{
public static readonly EventId ApplyProxyConfig = new EventId(1, "ApplyProxyConfig");
public static readonly EventId ApplyProxyConfigFailed = new EventId(2, "ApplyProxyConfigFailed");
Expand Down
4 changes: 2 additions & 2 deletions src/ReverseProxy/Utilities/AsyncSemaphore.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Collections.Generic;
Expand All @@ -12,7 +12,7 @@ namespace Microsoft.ReverseProxy.Utilities
/// <remarks>
/// Based on <c>https://blogs.msdn.microsoft.com/pfxteam/2012/02/12/building-async-coordination-primitives-part-5-asyncsemaphore/</c>.
/// </remarks>
public sealed class AsyncSemaphore
internal sealed class AsyncSemaphore
{
private readonly Queue<TaskCompletionSource<bool>> _waiters = new Queue<TaskCompletionSource<bool>>();
private int _count;
Expand Down
103 changes: 0 additions & 103 deletions src/ReverseProxy/Utilities/Cache.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/ReverseProxy/Utilities/Contracts.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
Expand All @@ -9,7 +9,7 @@ namespace Microsoft.ReverseProxy.Utilities
/// Simple argument validation helpers.
/// </summary>
// TODO: 6106627: find suitable replacement for CoreServicesBorrowed.Contracts
public static class Contracts
internal static class Contracts
{
/// <summary>
/// Verifies that <paramref name="value"/> is not null, and throws
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.ReverseProxy.Utilities
/// <summary>
/// Extensions for the <see cref="Exception"/> class.
/// </summary>
public static class ExceptionExtensions
internal static class ExceptionExtensions
{
/// <summary>
/// Determines whether the provided <paramref name="exception"/> should be considered fatal. An exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.ReverseProxy.Utilities
/// <summary>
/// Extensions for the <see cref="Task"/> class.
/// </summary>
public static class TaskExtensions
internal static class TaskExtensions
{
/// <summary>
/// Runs an action on the current scheduler instead of the default scheduler.
Expand Down
2 changes: 1 addition & 1 deletion src/ReverseProxy/Utilities/ThreadStaticRandom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.ReverseProxy.Utilities
/// <summary>
/// Provides a thread static implementation of random numbers that optimizes not to lock on every invocation of random number generation.
/// </summary>
public class ThreadStaticRandom
internal class ThreadStaticRandom
{
[ThreadStatic]
private static Random t_inst;
Expand Down
63 changes: 0 additions & 63 deletions src/ReverseProxy/Utilities/TimeSpanIso8601.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/ReverseProxy/Utilities/TimeUtil.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
Expand All @@ -8,7 +8,7 @@ namespace Microsoft.ReverseProxy.Utilities
/// <summary>
/// Time and date utilities.
/// </summary>
public static class TimeUtil
internal static class TimeUtil
{
/// <summary>
/// This is the maximum <see cref="TimeSpan"/> that <see cref="System.Threading.CancellationTokenSource.CancelAfter(TimeSpan)"/> will accept.
Expand Down
4 changes: 2 additions & 2 deletions src/ReverseProxy/Utilities/ValueStopwatch.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
Expand All @@ -12,7 +12,7 @@ namespace Microsoft.ReverseProxy.Utilities
/// <remarks>
/// Inspired on <seealso href="https://github.com/dotnet/extensions/blob/master/src/Shared/src/ValueStopwatch/ValueStopwatch.cs"/>.
/// </remarks>
public struct ValueStopwatch
internal struct ValueStopwatch
{
private static readonly double _timestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency;

Expand Down
46 changes: 0 additions & 46 deletions src/ReverseProxy/Utilities/WallClockTimer.cs

This file was deleted.

Loading

0 comments on commit 1d8a868

Please sign in to comment.