Hi,

Does someone remember what was the reason to introduce
FunctionsExecuter (FE) in wicket-ajax.js ?
It is used to execute functions which do the header contributions,
component replacements, code evaluations, etc.

I'm trying to see what is the real value of it.
Its JSDoc says that it tries to process the steps/functions
synchronously by using notify() but the processing will be synchronous
even without using FE at all. Header contributions, priority
evaluations, component replacements, ... will be processed
synchronously in #onSuccess() callback without the need of FE and the
additional functions which are executed in the same stack.

There are few problems with FE that I see:

1) if notify() is not executed by some step (due to thrown exception,
for example) then the ChannelManager may not release the current
channel. This will lead to a deadlock in the execution of Ajax
requests in this channel for any following click, change, blur, ...

2) FE#notify() leads to filling up the thread stack. Currently there
is a counter (FE#depth) that uses setTimeout() when the depth is 50.
But this setTimeout() breaks the synchronous/atomic execution of the
steps and may lead (as in
https://issues.apache.org/jira/browse/WICKET-4675) to interleaved
execution of several Ajax responses.

-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Reply via email to