This documentation relates to FusionReactor 3.5.x - If you use an other Version please check here: All Versions
The FRAPI lets you call FusionReactor methods directly from your ColdFusion pages. JavaDocs are available for the FRAPI and are available from the FusionReactor site. Lets first start with some simple examples though...
This is one of the simplest FRAPI calls:
This page simply outputs a YES/NO value depending on the running state of FusionReactor.
Now for something a little more interesting:
This bit of code will print out a list of all requests currently running. (We've added a wait at the bottom so we can run it several times and get a result something like this:
As well as getting information from FusionReactor, you can also use the FRAPI to change FusionReactor itself. The following code will change the timeout setting for Crash Protection for this request:
We also have the ability to set markers in pages. Look at this example:
After this page has run, if we go into FusionReactor and look at the request details for this request we fill see this marker listed along with the time at which it was set:
The ability to set markers within your pages has many useful purposes including following the path of execution, measuring execution time or simply outputting debug information without changing the final output or needing to read through log files.
As we hope you can see, the FRAPI is a very powerful new tool which has a lot of potential. As ever, if you have any feedback or suggestions for this or any other feature within FusionReactor, please let us know and we will try our best to include them in upcoming builds.