Make credential store awaitable

The storage mechanism for credentials is very likely to be an async data
store. So might as well play it safe and make it awaitable.
This commit is contained in:
Haacked
2013-10-08 16:19:08 -07:00
parent d8ba8ae6b6
commit 90f67dd37b
9 changed files with 63 additions and 15 deletions
+5 -3
View File
@@ -1,4 +1,6 @@
namespace Octokit.Internal
using System.Threading.Tasks;
namespace Octokit.Internal
{
public class InMemoryCredentialStore : ICredentialStore
{
@@ -11,9 +13,9 @@
_credentials = credentials;
}
public Credentials GetCredentials()
public Task<Credentials> GetCredentials()
{
return _credentials;
return Task.Factory.StartNew(() => _credentials);
}
}
}