From looking at the source, delay is actually ignored unless it's a
timer event or a continuation. So it won't have any effect here. To
enable this functionality we need some more framework side machinery.
Keeping the existing interface, the presence of a delay field should
automatically start a timer. Adding a "coalesce" field could toggle
between stacked events, and coalesced events (as needed in the
aforementioned problem). I think the framework should provide this
feature transparently, alternatively it could be achieved with a more
powerful client-side api.
In the mean time, my solution (hack) would be doing this with client-
side js, and sending an ajax request to a URL which bypasses nitrogen
altogether (by altering loop()).
Rusty will your next updates include a client-side api?
Slightly off topic, but one feature I'd really like to have, is the
ability to chain multiple hooks to nitrogen's ajax events. JQuery
supports this in it's comet model, allowing you to hook into various
stages of the request. These hook's could be p nitrogens laced in
existing event handlers.
Why is this useful?
This would enable users to set condition-guards, and pre-processing
filters on the data before it's actually sent. If any filter returns
false, the event is squelched, otherwise it passes data on to the next
hook/stage.
some pseudo code:
filter1(data) {
data2 = data.uppercase(),
return data2;}
filter2(data) {
return data unless moon_is_blue else false;
}
- Tom