ANN: Continuations and Exceptions - time outs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ANN: Continuations and Exceptions - time outs

Brent Pinkney-2
Hi,

The attached change set adds Continuation >> #signal:  that allows a Continuation to resume with a signalled Exception.
The change set also includes two new test cases.

This functionality will allow, inter alia, an external watchdog process to select old continuations and resume them
with a TimedOut exception. This is analagous to the existing #valueWithin:onTimeout:

Try this example (included in the change set preamble):

        "create a place to store a continuation..."
        Smalltalk at: #CC put: nil.
        Transcript open; clear.

        "fork a process that suspends on its continuation..."
        [ [    Transcript show: 'about to suspend...'; cr.
                Continuation currentDo: [ :cc | CC := cc. Processor activeProcess terminate ].
                Transcript show: 'resumed in time'; cr  ]
                        on: TimedOut
                        do: [ :e | Transcript show: e; cr ]  ] fork.

        "resume normally..."
        [ CC value ] fork.

        "resume with exception..."
        [ CC signal: TimedOut ] fork.

        "remove the continuation..."
        CC := nil.

I think this could really help cleanup how Seaside expires sessions.
Thoughts, inclusion ?

Thanks

Brent

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

continuationExceptions-brp.1.cs.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Continuations and Exceptions - time outs

Lukas Renggli
>  I think this could really help cleanup how Seaside expires sessions.
>  Thoughts, inclusion ?

Could you give a real example? I don't see how that would interact
with cleanup and session expiry.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Please Use Mantis (was Re: [squeak-dev] ANN: Continuations and Exceptions - time outs)

Ken Causey-3
In reply to this post by Brent Pinkney-2
Note that all Enhancements should be entered into the Mantis database
now

http://bugs.squeak.org/

I understand that you were probably thinking it should be discussed
first.  But frankly it would be really helpful if the discussion took
place in the Mantis report itself.  It is extremely annoying to find a
report on Mantis with a minimal description and absolutely no
discussion.  (Annoying to those with thoughts of harvesting that is.)
If discussion took place on squeak-dev that's wonderful but nearly
impossible to track back from the Mantis report unless some kind soul
includes a link in a note, even then it is rather awkward.

Ken

On Tue, 2008-08-12 at 23:12 +0200, Brent Pinkney wrote:

> Hi,
>
> The attached change set adds Continuation >> #signal:  that allows a Continuation to resume with a signalled Exception.
> The change set also includes two new test cases.
>
> This functionality will allow, inter alia, an external watchdog process to select old continuations and resume them
> with a TimedOut exception. This is analagous to the existing #valueWithin:onTimeout:
>
> Try this example (included in the change set preamble):
>
> "create a place to store a continuation..."
> Smalltalk at: #CC put: nil.
> Transcript open; clear.
>
> "fork a process that suspends on its continuation..."
> [ [    Transcript show: 'about to suspend...'; cr.
> Continuation currentDo: [ :cc | CC := cc. Processor activeProcess terminate ].
> Transcript show: 'resumed in time'; cr  ]
> on: TimedOut
> do: [ :e | Transcript show: e; cr ]  ] fork.
>
> "resume normally..."
> [ CC value ] fork.
>
> "resume with exception..."
> [ CC signal: TimedOut ] fork.
>
> "remove the continuation..."
> CC := nil.
>
> I think this could really help cleanup how Seaside expires sessions.
> Thoughts, inclusion ?
>
> Thanks
>
> Brent

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (196 bytes) Download Attachment