public async Task <ComponentStatus> EvaluateAsync(string component, CloudBlobClient client, Func <CloudBlobClient, Task <bool> > fn) { var details = new Dictionary <string, object> { ["Uri"] = client.BaseUri }; return(await fn(client) ? ComponentStatus.Up(component, details) : ComponentStatus.Down(component, details)); }
public async Task <ComponentStatus> EvaluateSubscriptionsAsync(string component, NamespaceManager namespaceManager, string topicPath, Func <IEnumerable <SubscriptionDescription>, bool> fn) { var subscriptions = await namespaceManager.GetSubscriptionsAsync(topicPath); var details = new Dictionary <string, object> { ["Uri"] = namespaceManager.Address, ["TopicPath"] = topicPath }; return(fn(subscriptions) ? ComponentStatus.Up(component, details) : ComponentStatus.Down(component, details)); }
public Task <ComponentStatus> EvaluateAsync() { var componentStatus = ComponentStatus.Up(Component, Details); return(Task.FromResult(componentStatus)); }
static Task <ComponentStatus> NothingFunc(Nothing _) => Task.FromResult(ComponentStatus.Up("Nothing"));