Chainable operations in a Continuation flow
The use of chained operations in C# is nothing new, we uses this feature in several different libraries.
Any method that returns an instance of itself is a fluent method, then, is capable of creates continuous process. Once again we can see this type of implementation in the System.Linq
namespace. With this namespace you can perform a filtering and a transformation through the methods Where
and Select
in a chainable operation, see an example:
As the previous example shows, it is possible to make several consecutive calls on a single command line. This is what we call a continuous or fluent process.
The Tango implements this feature in several types and modules, like Option
, Either
and even IEnumerable
.
In addition, there's a special object called Continuation
. This object is used mainly to this type of fluent process, but dealing with a success and a fail outputs.
Last updated
Was this helpful?