[Seaside] Problem with continuations/flow.

Julian Fitzell jfitzell at gmail.com
Tue May 24 07:50:51 UTC 2011


#actionUrlForContinuation: doesn't expect a first-class continuation
but rather a CPS continuation (a subclass of WASessionContinuation).
Actually, to be more accurate, WASession>>handleFiltered: expects that
to be so. Actually, to be more accurate, it expects something that
responds to successfully to #value.

Technically, I think you could avoid the error by doing:

testCC
     self inform: 'A'.
     self wait: [ :cc |
             self inform: 'B: ', ( self session
actionUrlForContinuation: [ cc value: nil ]) greaseString.
             self answer].
     self inform: 'C'.
     self answer.

However, I doubt you'll be happy with the results: part of the
implementation of WASessionContinuation>>value is to restore
backtracked state, and its subclasses do things like processing
callbacks and starting rendering. Without the handling that deals with
callbacks, for example, your call to #answer inside the block won't
work.

What are you trying to accomplish?

Julian

On Tue, May 24, 2011 at 6:50 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
> *humble bump*
>
> Am 2011-05-20 um 10:03 schrieb Tobias Pape:
>
>>
>> Am 2011-05-20 um 09:49 schrieb Tobias Pape:
>>
>>> Hi.
>>>
>>>
>>> Calling the following:
>>>
>>> testCC
>>>
>>>      self inform: 'A'.
>>>      self wait: [ :cc |
>>>              self inform: 'B: ', ( self session actionUrlForContinuation: cc).
>>>              self answer].
>>>      self inform: 'C'.
>>>      self answer.
>>>
>>>
>>> allways results in an error:
>>>
>>
>> Ok, this is incorret,
>> Calling the url generated by ( self session actionUrlForContinuation: cc)
>> results in the error.
>>
>>> Error: This block accepts 1 argument, but was called with 0 arguments.
>>>
>>> In WASession>>handleFiltered:
>>>
>>> handleFiltered: aRequestContext
>>>      | key continuation |
>>>      key := aRequestContext request fields
>>>              at: self actionField
>>>              ifAbsent: [ ^ self start ].
>>>
>>>      continuation := continuations
>>>              at: key
>>>              ifAbsent: [ ^ self unknownRequest ].
>>>      continuation value
>>>
>>> at the last line.
>>> Continuation is
>>>      outerContext: GRPharoPlatform>>seasideSuspendFlowDo: startpc: 54 numArgs: 1
>>>
>>>
>>> So Long,
>>>      -Tobias
>>>
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list