Resilient
Classes
Task

A task is an operation which may fail. More...

Classes

class  resilient::Failable< Value, Failure >
 A class to represent the result of an operation which might fail. More...
 
class  resilient::Task< Callable, FailureDetector >
 Create a task from a callable, using a Detector to detect failures. More...
 

Detailed Description

A task is an operation which may fail.

Description

Operations, especially the ones which have to interact with an external system (a web service, perform IPC, etc...), might fail. A task acknowledges this and make it explicit in its return type: either a result value or a failure.

The Concept

A task is any callable object which returns a Failable when invoked.

Any callable object can be transformed into a task by instantiating a resilient::Task and adding some detectors for the failure conditions.