Description
Trybot is a transient fault handling framework including such resiliency solutions as Retry, Timeout, Fallback, Rate limit and Circuit Breaker. The framework is extendable with custom, user-defined bots as well.
trybot alternatives and similar packages
Based on the "Misc" category.
Alternatively, view trybot alternatives based on common mentions on social networks and blogs.
-
Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+. -
Humanizer
Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities -
Coravel
Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze! -
Hashids.net
A small .NET package to generate YouTube-like hashes from one or many numbers. Use hashids when you do not want to expose your database ids to the user. -
Scientist.NET
A .NET library for carefully refactoring critical paths. It's a port of GitHub's Ruby Scientist library -
WorkflowEngine
WorkflowEngine.NET - component that adds workflow in your application. It can be fully integrated into your application, or be in the form of a specific service (such as a web service). -
HidLibrary
This library enables you to enumerate and communicate with Hid compatible USB devices in .NET. -
DeviceId
A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer. -
Warden
Define "health checks" for your applications, resources and infrastructure. Keep your Warden on the watch. -
Aeron.NET
Efficient reliable UDP unicast, UDP multicast, and IPC message transport - .NET port of Aeron -
ByteSize
ByteSize is a utility class that makes byte size representation in code easier by removing ambiguity of the value being represented. ByteSize is to bytes what System.TimeSpan is to time. -
DeviceDetector.NET
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model. -
Mediator.Net
A simple mediator for .Net for sending command, publishing event and request response with pipelines supported -
https://github.com/minhhungit/ConsoleTableExt
A fluent library to print out a nicely formatted table in a console application C# -
Valit
Valit is dead simple validation for .NET Core. No more if-statements all around your code. Write nice and clean fluent validators instead! -
FormHelper
ASP.NET Core - Transform server-side validations to client-side without writing any javascript code. (Compatible with Fluent Validation) -
SolidSoils4Arduino
C# .NET - Arduino library supporting simultaneous serial ASCII, Firmata and I2C communication -
Validot
Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers. -
NaturalSort.Extension
๐ Extension method for StringComparison that adds support for natural sorting (e.g. "abc1", "abc2", "abc10" instead of "abc1", "abc10", "abc2"). -
Outcome.NET
Never write a result wrapper again! Outcome.NET is a simple, powerful helper for methods that return a value, but sometimes also need to return validation messages, warnings, or a success bit. -
SystemTextJson.JsonDiffPatch
High-performance, low-allocating JSON object diff and patch extension for System.Text.Json. Support generating patch document in RFC 6902 JSON Patch format.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of trybot or a related project?
Popular Comparisons
README
trybot
Trybot is a transient fault handling framework including such resiliency solutions as Retry, Timeout, Fallback, Rate limit and Circuit Breaker. The framework is extendable with custom, user-defined bots.
Github (stable) | NuGet (stable) | MyGet (pre-release) |
---|---|---|
Bots
Retry - Allows to configure auto re-execution of an operation based on exceptions it throws, or on its return value.
Timeout - Ensures that the caller won't have to wait indefinitely for an operation to finish by setting a maximum time range within the given operation should be executed.
Fallback - Handles faults by executing an alternative operation when the original one is failing, also provides the ability to produce an alternative result value when the original operation is not able to do it.
Circuit breaker - When the number of failures exceeds a given threshold, this bot prevents the continuous re-execution of the failing operation by blocking the traffic for a configured amount of time. This usually could give some break to the remote resource to heal itself properly.
Rate limit - Controls the rate of the operations by specifying a maximum amount of executions within a given time window.
Supported platforms
- .NET 4.5 and above
- .NET Core
- Mono
- Universal Windows Platform
- Xamarin (Android/iOS/Mac)
- Unity
Usage
During the configuration of a bot policy you can chain different bots to eachother.
policy.Configure(policyConfig => policyConfig
.CircuitBreaker(circuitBreakerConfig => circuitBreakerConfig
.DurationOfOpen(TimeSpan.FromSeconds(10))
.BrakeWhenExceptionOccurs(exception => exception is HttpRequestException),
strategyConfig => strategyConfig
.FailureThresholdBeforeOpen(5)
.SuccessThresholdInHalfOpen(2))
.Retry(retryConfig => retryConfig
.WithMaxAttemptCount(5)
.WhenExceptionOccurs(exception => exception is HttpRequestException)
.WaitBetweenAttempts((attempt, exception) =>
{
if(exception is CircuitOpenException cbException)
return TimeSpan.FromSeconds(cbException.OpenDuration);
return TimeSpan.FromSeconds(Math.Pow(2, attempt);
})))
.Timeout(timeoutConfig => timeoutConfig
.After(TimeSpan.FromSeconds(120))));
The handling order of the given operation would be the same as the configuration order from the top to the bottom. That means in the example above that the circuit breaker will try to execute the given operation first, then if it fails the retry bot will start to re-execute it until the timeout bot is not signaling a cancellation.
Then you can execute the configured policy:
With cancellation:
var tokenSource = new CancellationTokenSource(); policy.Execute((context, cancellationToken) => DoSomeCancellableOperation(cancellationToken), tokenSource.Token);
With a custom correlation id:
var correlationId = Guid.NewGuid(); policy.Execute((context, cancellationToken) => DoSomeOperationWithCorrelationId(context.CorrelationId), correlationId);
Without setting a custom correlation id, the framework will always generate a unique one for every policy execution.
Synchronously:
// Without lambda parameters policy.Execute(() => DoSomeOperation()); // Or with lambda parameters policy.Execute((context, cancellationToken) => DoSomeOperation());
Asynchronously:
// Without lambda parameters await policy.ExecuteAsync(() => DoSomeAsyncOperation()); // Or with lambda parameters await policy.ExecuteAsync((context, cancellationToken) => DoSomeAsyncOperation());
You can also create your custom bots as described here.
Community
Extensions
- ASP.NET Core
- Other