Skip to content
Akash Kava edited this page Nov 10, 2021 · 5 revisions

Eternity Framework

Long running workflows with ability to suspend and replay the workflow in future. Workflow is set of activities called in RunAsync method, state of each activity is persisted in history table so that replay will achieve same result.

NuGet

Name Package
NeuroSpeech.Eternity NuGet
NeuroSpeech.Eternity.DependencyInjectionExtensions NuGet
NeuroSpeech.Eternity.AzureStorage NuGet
NeuroSpeech.Eternity.SqliteStorage NuGet
NeuroSpeech.Eternity.Mocks NuGet

Features

  1. Strongly typed API
  2. Mobile Ready - Storage is abstract and does support running workflows in Mobile Devices.
  3. Dependency Injection - easy integration with Microsoft Dependency Injection Extensions
  4. Activities are simple public virtual C# methods
  5. Support for external events, workflow can wait for external events
  6. Really very large workflow supports, duration of waiting can have timeout for days/months/weeks. This allows in creating workflow for monthly/yearly memberships.
  7. Abstract Storage - you can create your own storage, in memory Mock storage, Sqlite Storage (for mobile) and Azure Table Storage is included.
  8. Unit testable - Mocks package contains useful mocks to unit test your workflows.
  9. Support for non deterministic workflows, activities are isolated by parameters and time of execution, (you can also make Activity unique) so same activity method with same parameter anywhere in the workflow will execute only once and will give same result.
  10. Workflow can wait for multiple events, and when you raise an event, it will optionally throw an exception if workflow is not waiting.
  11. You can wait for events for days/months. It does not occupy any resources, waiting occurs in queue, and workers do not stay busy while waiting.
  12. .NET Standard 2.0 support, it means it can run anywhere without any native/local dependency.

Activity Execution Logic

Activity Workflow

  1. Activities are only executed once which are guaranteed via lock, an activity must finish successfully in 60 seconds.
  2. Activities can be scheduled in future.

Comparison with Durable Tasks

  1. Eternity framework allows non deterministric workflows. Activity replay is only dependent on parameters passed to the activity.
  2. Inside a workflow, a method name with same set of parameters at the same timeline will never be executed again.
  3. You can also mark activity as unique parameters to make activity unique throughtout the execution.
  4. An event can only be raised if workflow is waiting for an event, unlike Durable Tasks. You can choose to fire an exception if workflow is not waiting for an event.
  5. You can wait for an event from days to months. You can easily create workflows for membership renewals etc.
  6. We have created Mock Storage, you can unit test your workflows spanning days/months easily against in memory storage.
  7. Storage engine interface is small, you can easily use it to create storage even on mobile devices. We will soon offer Sqlite storage.
Clone this wiki locally