通常情况下,在Seaside,您根本不需要自己处理Continuations.
您只需在组件中使用#call:和使用#answer:.
如果您正在尝试使用Continuation除了编写Seaside应用程序之外的其他操作,请查看WAComponent>>call:使用示例.
或试试这个.打开Transcript窗口.现在,在Workspace中,立即选择所有这些代码并执行操作:
continuation := nil.
result := Continuation currentDo: [:cc |
"store the continuation, cc, somewhere for later use"
continuation := cc.
1 ].
Transcript show: result.
Run Code Online (Sandbox Code Playgroud)
您应该看到1在Transcript窗口中显示.现在,在工作区中,执行:
continuation value: 2
Run Code Online (Sandbox Code Playgroud)
然后:
continuation value: 3
Run Code Online (Sandbox Code Playgroud)
您应该看到传递给continuationTranscript的每个值都显示,因为传递给#value的每个值都会导致延续上下文并分配新值result.
希望这有助于......