cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miles Elam <mi...@pcextremist.com>
Subject Re: Changes made to flow system.js
Date Thu, 05 Dec 2002 23:34:18 GMT
> Stefano Mazzocchi wrote:
>
>> Andy Lewis wrote:
>>
>>> what about I/O terms?
>>>
>>> sendPageBlocking
>>> sendPageNonBlocking
>>
>> I still like the concept of "waiting" a lot more. In short, your 
>> 'server' is waiting for you to come back. It would be like having 
>> your personal thread allocated in the server, even if this is not the 
>> case. 
>
What about:

  sendNextPage
  sendLastPage

The first implies a continuation (no pun intended) of a sequence of 
pages.  The second implies the end of a sequence of pages.  Why wait?

Coming from page foo1:

  doItem1();
  sendNextPage(foo2);
  doItem2();
  sendNextPage(foo3);
  doItemN();
  sendNextPage(fooN);
  finishProcessing();
  sendLastPage();
  doNecessaryCleanupAndPostprocessing();

You're not waiting.  From the conceptual level of the flow script, 
you're just doing the next item on the list.  The fact that sendNextPage 
blocks or takes more time to finish seems to me like a side effect, not 
a focus.  You're not waiting for the wait to end.  You're waiting for 
the function to end.  It just so happens that the function blocks 
internally until an (implementation dependent) event to occur.  Wasn't 
that the point of the flow system: to make logic fit conceptually into a 
natural sequence?

After all, it's

  ServerSocket ss = new ServerSocket(80);
  Socket s = ss.accept();

and not

  ServerSocket ss = new ServerSocket(80);
  Socket s = ss.waitForIncomingConnectionUnlessTimeout();

Thoughts?

- Miles



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message