<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3492" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=375165211-09042009>Thanks for the clarification 
Julian.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=375165211-09042009>I've pretty much did that notification handling to make 
things work as expected (I mean instead of the ifCurtailed).</SPAN></FONT></DIV>
<DIV><SPAN class=375165211-09042009></SPAN><FONT face="Trebuchet MS"><FONT 
color=#0000ff><FONT size=2>s<SPAN 
class=375165211-09042009>ebastian</SPAN></FONT></FONT></FONT><BR></DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>De:</B> 
  seaside-dev-bounces@lists.squeakfoundation.org 
  [mailto:seaside-dev-bounces@lists.squeakfoundation.org] <B>En nombre de 
  </B>Julian Fitzell<BR><B>Enviado el:</B> Thursday, April 09, 2009 
  07:35<BR><B>Para:</B> Seaside - developer list<BR><B>Asunto:</B> Re: 
  [Seaside-dev] hot to not use continuations<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV class=gmail_quote>On Thu, Apr 2, 2009 at 11:31 PM, Sebastian Sastre <SPAN 
  dir=ltr>&lt;<A 
  href="mailto:ssastre@seaswork.com">ssastre@seaswork.com</A>&gt;</SPAN> 
  wrote:<BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Folks, 
    just for the record:<BR>I've found a cause of problems unless you're 
    prepared:<BR><BR>I was using a block with ifCurtailed: wrapping the process 
    of action and<BR>rendering. By wrapping I mean someting about a filter 
    depends on it.<BR><BR>Incidentally, the ifCurtailed: was basically there to 
    make a rollback and/or<BR>unlock any locked objects of a non flawless 
    transaction.<BR>So, to prevent surprises, developers must expect 
    WAResponseNotification at any<BR>time. This means that a non resumable 
    notification will be triggered at any<BR>moment when the action/render block 
    is evaluated.</BLOCKQUOTE>
  <DIV><BR>Well, #handleFiltered: *may* return normally; WAResponseNotification 
  is used to indicate that a RequestHandler wants to *immediately* abort 
  processing and return a response. In practice though, when using RenderLoop, 
  we pretty much always signal a notification.<BR><BR></DIV>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><FONT 
    face="Trebuchet MS" color=#0000ff size=2></FONT><BR>As it's not resumable, 
    the block will be evaluating the ifCurtailed even when<BR>all is perfectly 
    fine.<BR></BLOCKQUOTE>
  <DIV><BR>The fact that the notification is non-resumeable is not really the 
  issue. The notification will always be caught by the ServerAdaptor and that 
  will cause the stack to be unwound, which causes your #ifCurtailed: to be 
  called. Your code *is* being abnormally terminated by a request to immediately 
  return a response.<BR><BR>Try executing this (which uses a resumeable 
  notification) in a workspace, for example:<BR><BR>[[nil notify: 1] 
  ifCurtailed: [Transcript show: 'curtailed']]<BR>&nbsp;&nbsp;&nbsp; on: 
  Notification do: []<BR><BR>Filters or request handlers can, of course, 
  intercept the WAResponseNotification and modify the Response as they see 
  fit.<BR><BR>Julian<BR></DIV></DIV><BR></BLOCKQUOTE></BODY></HTML>