Jump to: navigation, search

TaskFlow/Best practices

< TaskFlow
Revision as of 02:39, 12 October 2013 by Harlowja (talk | contribs) (Top 5)

Summary

Best practices.png

Why

Since taskflow creates a path toward stable, resumable, and trackable workflows it is helpful to have a small set of recommended best practices to make sure you as a user of taskflow (the library) maximize the benefit you receive from using taskflow. Certain common patterns and best practices will be listed below (with examples) to show the what, why and how so that you can maximize your taskflow experience and minimize the pain associated with understanding some of the taskflow key primitives. This list will likely continue growing as new usages of taskflow emerge (and new features are introduced into taskflow), please feel free to add any of your own below.

Top 5

  • Create tasks that do one thing well (and only one thing); if that task has side-effects undo those side-effects in the revert method.
  • Clearly define what a task provides so that future (potentially not yet created) tasks can depend on those outputs.
  • Clearly define what a task requires so that taskflow engine/s can deduce the correct order to run your tasks in.
  • Be very careful about RPC boundaries (especially when the workflow spans this boundary) and choose how you deal with this in a careful manner.
  • Always associate a version with your tasks so that one software upgrades the partially completed tasks can be migrated & resumed.