[Seaside-dev] [Dolphin] Assertion failed on
WAFlowPlatformTest>>testSuspendCallbackDo
Lukas Renggli
renggli at gmail.com
Mon Sep 14 16:58:22 UTC 2009
> First, I have implemented #suspendFlowDo: as simply as:
>
> suspendFlowDo: aBlock
>
> ^WAContinuation currentDo: aBlock
>
> I'm not sure if it is correct but in the practice works well...
I don't know how WAContinuation is implemented on Dolphin, but a full
continuation definitely does not work.
> #testSuspendCallbackDo is failing:
>
> testSuspendCallbackDo
> | continuation result |
> continuation := nil.
> self withCallbackContinuationDo: [ :cc | continuation := cc ]
> resultBlock: [ :r | result := r ].
> self assert: continuation notNil.
> self evaluateCallbackContinuation: continuation with: 123.
> self assert: result = 123
>
> This is a bit confusing but after the statement
> self withCallbackContinuationDo: [ :cc | continuation := cc ]
> resultBlock: [ :r | result := r ].
> was executed the local "continuation" has aWAContinuation as value and
> the assert succeeds,
> after the statement
> self evaluateCallbackContinuation: continuation with: 123.
> is executed and the continuation resumes, but this time the local
> "continuation" has nil.
The full continuation restores too much state. It should only restore
up to the first frame of WACallback.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
More information about the seaside-dev
mailing list