square/workflow-kotlin

Improve lifecycle docs on Workflow, RenderContext

开放

#356 创建于 2021年3月5日

 (3 条评论) (1 个反应) (0 位负责人)Kotlin (112 个派生)github user discovery
documentationgood first issue

仓库指标

星标
 (1,120 个星标)
PR 合并指标
 (平均合并 55天 8小时) (30 天内合并 9 个 PR)

描述

Quoth @Armaxis:

In Workflow.kt docs there’s a paragraph stating:

This context allows the workflow to interact with the outside world by doing things like listening for events, subscribing to streams of data, rendering child workflows, and performing cleanup when the workflow is about to be torn down by its parent. See the documentation on RenderContext for more information about what it can do. I searched around the RenderContext but haven’t found anything about the cleanup process of workflows. Is there anywhere I can read more in-depth?

Context: I was searching for a way to cancel payment when Workflow is no longer rendered, and it took quite some time to find LifecycleWorker. I wish Workflow would point better to it?

My first instinct was to search for onCleared/onCanceled somewhere in workflows -> then dig around RenderContext -> Cmd+F for cancel -> LifecycleWorker

贡献者指南