fieldenms / tg

Trident Genesis
MIT License
14 stars 7 forks source link

Continuations: initialisation with an instance (as opposed to a type) #2281

Open 01es opened 3 months ago

01es commented 3 months ago

Description

Continuation is initiated by throwing an exception of type NeedMoreData that is initialised with a type of an action-entity, representing that continuation. This happens in method save for an entity that requires more data before it can be saved. The actual instantiation and initialisation of a continuation of the specified type happens elsewhere. Custom initialisation can happen in a producer, defined for a continuation. However, the producer does not have a context in which the need for continuation was identified. This makes it difficult and cumbersome to pass some state around if a continuation instance should be initialised based on the data, available in save at the time NeedMoreData in thrown.

Expected outcome

A way to initiate a continuation with an instance rather than just a type of continuation.