is an option for asynchronous operations that specifies functions to apply when events are generated.
- The typical setting for HandlerFunctions is "event1"->f1,"event2"->f2,…, which specifies that when eventi is generated, the function fi should be applied to an association whose elements are specified by HandlerFunctionsKeys.
- The events that can be generated by particular tasks are listed under the functions that submit the tasks.
- In the HandlerFunctions association, the special element "UnhandledEvent"->f uses the function f for any event for which no explicit handler was specified.
Basic Examples (8)
Display the result of evaluation after the task is finished:
Print the complete Association available to a handler function:
Display the result of Print evaluated in a subkernel:
Display a dialog when a message is generated:
Print messages generated by the subkernel:
Handle the "BodyReceived" event when it is generated by URLSubmit:
Store the headers with a variable when they are received:
Print the status code and content type when the task is finished:
Wolfram Research (2016), HandlerFunctions, Wolfram Language function, https://reference.wolfram.com/language/ref/HandlerFunctions.html.
Wolfram Language. 2016. "HandlerFunctions." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HandlerFunctions.html.
Wolfram Language. (2016). HandlerFunctions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HandlerFunctions.html