Base2art.Threading.OneTryLazy<T>
Base2art.Threading.RetryLazy<T>
Base2art.Threading.OneTryEnsurer
Base2art.Threading.RetryEnsurer
Base2art.Threading.Tasks.Thenner
public Task<string[]> GetPeopleNames()
{
// GetPeople returns Task<Person[]>
return database.GetPeople()
.Then()
.Select(x => x.FirstName + " " + x.LastName)
.Then()
.ToArray();
}
Base2art.Threading.OneTryLazy<T>
ILazy<string> lazy = new OneTryLazy<string>(() => {
// If the following throws an exception it will throw an exception on
// all subsequent calls to lazy.value
var result = database.GetPeople();
return result.Length == 1 ? "1 Person" : (result.Length + " People");
};
Base2art.Threading.RetryLazy<T>
ILazy<string> lazy = new RetryLazy<string>(() => {
// If the following throws an exception it will retry on
// all subsequent calls to lazy.value
var result = database.GetPeople();
return result.Length == 1 ? "1 Person" : (result.ToString() + " People");
};