Skip to content

We need a better compromise between performance and brevity for how we manage StatelessWorkflow #1337

@steve-the-edwards

Description

@steve-the-edwards

The current design for how we get a StatefulWorkflow from the StatelessWorkflow is a failed compromise between performance (caching) and type-safe brevity (erasing the StateT type from the concerns of StatelessWorkflow). It needs to be fixed with a bigger re-write.

As a clear example of its failure. Right now we cache the RenderContext in the instance of the StatelessAsStatefulWorkflow inner class. This same instance is re-used by any and all uses of the underlying StatelessWorkflow in the workflow tree, meaning that the RenderContext will need to be re-created every time it is used again in the tree as there will be a new RenderContext created by the new session/node.

So the caching only really works when we use it once and only once, otherwise it is still re-created each time in render() since we compare with instance equality !==.

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