Skip to content

Commit

Permalink
remove protected method RequestFinished
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Sep 10, 2021
1 parent 8ed0f60 commit 86e1ba0
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions DragonFruit.Common.Data/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Threading;
using DragonFruit.Common.Data.Exceptions;
using DragonFruit.Common.Data.Headers;
Expand Down Expand Up @@ -341,7 +340,7 @@ protected T InternalPerform<T>(HttpRequestMessage request, Func<HttpResponseMess
{
// exit the read lock as soon as the request has been sent and processed
// this is because the callback could involve re-processing the request.
RequestFinished();
_lock.ExitReadLock();
}

try
Expand Down Expand Up @@ -405,24 +404,5 @@ public void RequestClientReset(bool fullReset)
Interlocked.CompareExchange(ref _clientAdjustmentRequestSignal, 1, 0);
}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected void RequestFinished() => _lock.ExitReadLock();
}

/// <summary>
/// A <see cref="ApiClient"/> superclass designed to allow better serializer configuration
/// </summary>
/// <typeparam name="T">The <see cref="ApiSerializer"/> to use</typeparam>
public class ApiClient<T> : ApiClient where T : ApiSerializer, new()
{
public ApiClient(Action<T> configurationOptions = null)
: base(Activator.CreateInstance<T>())
{
if (configurationOptions != null)
{
Serializer.Configure(configurationOptions);
}
}
}
}

0 comments on commit 86e1ba0

Please sign in to comment.