What are the differences in the qualifiers used for declaring FatFractal event handlers in FFDL?

StackOverflow https://stackoverflow.com/questions/15868665

  •  02-04-2022
  •  | 
  •  

Question

I've noticed a few variations in how event handlers can be defined in FFDL involving the use of certain qualifiers or keywords. For example, I've seen the use of both POST and ASYNC keywords:

CREATE HANDLER SupportRequestCreate ASYNC ON /SupportRequest CREATE AS javascript:require ('scripts/SupportEventHandlers').handleSupportRequestCreate();

CREATE HANDLER UserCreate POST ON /FFUser CREATE AS javascript:require ('scripts/UserEventHandlers').handleUserCreate();

Just wondering what are the differences between these keywords (or any other keywords) as it pertains to the behavior of the event handlers?

Was it helpful?

Solution

The keywords you mention specify the timing of event handler execution relative to the triggering event itself. There are three choices:

  • PRE -- event handler is triggered synchronously with the event, and execute before the event itself. This is useful for tasks such as validation.
  • POST -- event handler is triggered synchronously with the event, and executes after the event itself.
  • ASYNC -- event handler is triggered asynchronously with the event.

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top