Callback Functions

During a script run, you may want the script to execute a part of BDL code to react to one or more particular situations. You can use a callback function to let the script execute that part of BDL code whenever the situation occurs.

Use the attribute ASYNC_CALLBACK_FUNCTION in a callback function for an asynchronous response handling.

Example

benchmark BenchmarkName
use "WebAPI.bdh"

dcluser
  user
    WebUser
  transactions
    TMain : 1;

dclfunc
  function AsyncCallback <ASYNC_CALLBACK_FUNCTION>
  begin
    Print("callback");
  end AsyncCallBack;

dcltrans
  transaction TMain
    begin
      WebAsyncPreparePush(callback(AsyncCallback));
      ...
  end TMain