Skip to content
This repository was archived by the owner on May 18, 2021. It is now read-only.
This repository was archived by the owner on May 18, 2021. It is now read-only.

Transactional Creation of Flows #116

@gviedma-zz

Description

@gviedma-zz

Currently, when a flow is created by the primary function invocation, the stages are executed eagerly as the flow is constructed. If adding a stage subsequently fails, the user's flow will be partially executed and partially constructed. Stages that executed prior to the construction failure could have side effects, and any subsequent error-handling will be skipped, preventing the user from managing rollbacks.

For example, a function invocation could attempt to construct the following flow

Flows.currentFlow().invokeFunction(otherFunction).thenApply(operation).exceptionally(rollback); 

successfully creating an invoke stage and executing otherFunction with side-effects. It could then fail to create the next stage associated with operation. This failure will bubble up and the function call will fail, also preventing the exceptionally stage from being constructed and running the rollback logic.

As a developer of Fn Flow applications with side-effects, I would like to be able to execute the above types of flows safely in a transactional manner, such that any operations associated with my flow are only executed once the flow has been safely constructed and my error-handling is in place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions