Skip to content

Commit

Permalink
Removing breaking changes made between 2.5.6 and 2.5.8 (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsquire authored Jan 7, 2022
1 parent a720fcf commit a30adac
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Microsoft.Azure.Amqp/Singleton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace Microsoft.Azure.Amqp
{
using System;
using System.ComponentModel;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -45,6 +46,15 @@ public Task OpenAsync()
return this.OpenAsync(CancellationToken.None);
}

// Deprecated, but needs to stay available to avoid
// breaking changes. The attribute removes it from
// any code completion listings and doc generation.
[EditorBrowsable(EditorBrowsableState.Never)]
public Task OpenAsync(TimeSpan timeout)
{
return this.GetOrCreateAsync(timeout);
}

public Task OpenAsync(CancellationToken cancellationToken)
{
return this.GetOrCreateAsync(cancellationToken);
Expand Down Expand Up @@ -123,6 +133,12 @@ protected virtual bool IsValid(TValue value)
return true;
}

// Deprecated, but needs to stay available to avoid
// breaking changes. The attribute removes it from
// any code completion listings and doc generation.
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual Task<TValue> OnCreateAsync(TimeSpan timeout) => OnCreateAsync(timeout, CancellationToken.None);

protected abstract Task<TValue> OnCreateAsync(TimeSpan timeout, CancellationToken cancellationToken);

protected abstract void OnSafeClose(TValue value);
Expand All @@ -143,7 +159,11 @@ internal bool TryGet(out TValue value, Func<TValue, bool> condition)
return false;
}

internal async Task<TValue> GetOrCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
// Deprecated, but needs to stay available to avoid
// breaking changes. The attribute removes it from
// any code completion listings and doc generation.
[EditorBrowsable(EditorBrowsableState.Never)]
public async Task<TValue> GetOrCreateAsync(TimeSpan timeout, CancellationToken cancellationToken)
{
var timeoutHelper = new TimeoutHelper(timeout);

Expand Down

0 comments on commit a30adac

Please sign in to comment.