Skip to content

Commit

Permalink
Remove AsyncLazy<T> (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
martincostello authored and slang25 committed Nov 26, 2018
1 parent ad93d65 commit 2d09e66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
15 changes: 0 additions & 15 deletions JustSaying/AwsTools/AsyncLazy.cs

This file was deleted.

9 changes: 4 additions & 5 deletions JustSaying/AwsTools/MessageHandling/LocalTopicArnProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ namespace JustSaying.AwsTools.MessageHandling
public class LocalTopicArnProvider : ITopicArnProvider
{
private readonly IAmazonSimpleNotificationService _client;
private readonly AsyncLazy<string> _lazyGetArn;
private readonly Lazy<Task<string>> _lazyGetArnAsync;
private bool _exists;

public LocalTopicArnProvider(IAmazonSimpleNotificationService client, string topicName)
{
_client = client;

_lazyGetArn = new AsyncLazy<string>(() => GetArnInternalAsync(topicName));
_lazyGetArnAsync = new Lazy<Task<string>>(() => GetArnInternalAsync(topicName));
}

private async Task<string> GetArnInternalAsync(string topicName)
Expand All @@ -35,13 +35,12 @@ private async Task<string> GetArnInternalAsync(string topicName)

public Task<string> GetArnAsync()
{
return _lazyGetArn.Value;
return _lazyGetArnAsync.Value;
}

public async Task<bool> ArnExistsAsync()
{
// ReSharper disable once UnusedVariable
var ignored = await _lazyGetArn.Value.ConfigureAwait(false);
_ = await _lazyGetArnAsync.Value.ConfigureAwait(false);
return _exists;
}
}
Expand Down

0 comments on commit 2d09e66

Please sign in to comment.