Skip to content

Instantly share code, notes, and snippets.

@AlonAm
Last active April 25, 2019 19:35
Show Gist options
  • Select an option

  • Save AlonAm/1fd5b587b42e358570b99abeaadcf4a3 to your computer and use it in GitHub Desktop.

Select an option

Save AlonAm/1fd5b587b42e358570b99abeaadcf4a3 to your computer and use it in GitHub Desktop.
using AnyStatus.API;
using System.Threading.Tasks;
public class MyWidgetHealthCheck : ICheckHealth<MyWidget>
{
public async Task Handle(HealthCheckRequest<MyWidget> request, CancellationToken cancellationToken)
{
var myWidget = request.DataContext;
await Task.Delay(1).ConfigureAwait(false);
if (true)
{
myWidget.State = State.Ok;
}
else
{
throw new Exception("My widget health check failed.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment