({{, (RefLink[HandlerFunctionsKeys, paclet:ref/HandlerFunctionsKeys]) 
is an option for asynchronous operations that specifies the content of associations to which to apply handler functions. }})

OpenersNotesSection(Spacer1)Details

The following are typical settings for (RefLink[HandlerFunctionsKeys, paclet:ref/HandlerFunctionsKeys]):

The keys available with particular tasks are listed under the functions that submit the tasks.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (7)

Display the result of evaluation after the task is finished:

SessionSubmit[Integrate[Log[t]^4/Sqrt[1-t^2],{t,0,1}],HandlerFunctions-><|"TaskFinished":>MessageDialog|>,HandlerFunctionsKeys->{"EvaluationResult"}]

Print the complete (RefLink[Association, paclet:ref/Association]) available to a handler function:

SessionSubmit[N[Pi,200],HandlerFunctions-><|"TaskFinished"->Print|>,HandlerFunctionsKeys->All]

Display the result of the (RefLink[Print, paclet:ref/Print]) evaluated in a subkernel:

LocalSubmit[Print["Hello!"],
HandlerFunctions-><|"PrintOutputGenerated"->(Print[#PrintOutput]&)|>,
HandlerFunctionsKeys->{"EvaluationExpression","PrintOutput"}]

Display a dialog when the message was generated:

SessionSubmit[1/0,HandlerFunctions-><|"MessageGenerated"->MessageDialog|>,
HandlerFunctionsKeys->{"EvaluationExpression","MessageOutput"}]

Print the message generated by the subkernel:

LocalSubmit[1/0,HandlerFunctions-><|"MessageGenerated" -> (Message[#MessageOutput]&)|>,HandlerFunctionsKeys->{"MessageOutput"}]

Specify that the status code and content type are to be passed to any handler function:

URLSubmit["http://www.wolfram.com",HandlerFunctions-><|"TaskFinished"->Print|>, HandlerFunctionsKeys->{"StatusCode", "ContentType"}]

Receive the body of the response as a string:

URLSubmit["http://www.wolfram.com",HandlerFunctions-><|"BodyReceived"->Print|>, HandlerFunctionsKeys->{"Body"}]

Receive the body of the response as a list of bytes:

URLSubmit["http://www.wolfram.com",HandlerFunctions-><|"BodyReceived"->Print|>, HandlerFunctionsKeys->{"BodyBytes"}]

Receive the body of the response as a (RefLink[ByteArray, paclet:ref/ByteArray]):

URLSubmit["http://www.wolfram.com",HandlerFunctions-><|"BodyReceived"->Print|>, HandlerFunctionsKeys->{"BodyByteArray"}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[HandlerFunctions, paclet:ref/HandlerFunctions])  ▪  (RefLink[URLSubmit, paclet:ref/URLSubmit])  ▪  (RefLink[HTTPRequestData, paclet:ref/HTTPRequestData])  ▪  (RefLink[SessionSubmit, paclet:ref/SessionSubmit])  ▪  (RefLink[LocalSubmit, paclet:ref/LocalSubmit])  ▪  (RefLink[CloudSubmit, paclet:ref/CloudSubmit])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Background & Scheduled Tasks, paclet:guide/BackgroundAndScheduledTasks])}, {▪(RefLinkPlain[HTTP Requests & Responses, paclet:guide/HTTPRequestsAndResponses])}})}})