[squeak-dev] ANN: Continuations and Exceptions - time outs

Brent Pinkney brent at zamail.co.za
Tue Aug 12 21:12:26 UTC 2008


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: continuationExceptions-brp.1.cs.gz
Type: application/x-gzip
Size: 860 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080812/5ab60f54/continuationExceptions-brp.1.cs.bin


More information about the Squeak-dev mailing list