HSMOD.REST.Async.ClientBase
abstract class HSMOD.REST.Async.ClientBase
Handy base class that can be extended by "client" code to handle async job management. Assumes that "client" code will call ##class(HSMOD.REST.Async.API).RunInBackgroundAndReturnJobKey() to get a job key, which can then be used in these methods. @API.OverrideableMethod Inventory
Parameters
parameter DOMAIN = HS;
parameter UpperTimeLimit = 900;
maximum time to hang, in seconds, for a response (15 minutes). Can be overridden,
or you can override the GetTimeLimit method for custom logic.
@API.Overrideable
Methods
@API.Method
@Argument pJobKey Job key for which we should retrieve results stream.
FeedbackOpens in a new tab
@Argument pJobKey Job key for which we should retrieve results stream.
classmethod GetJobResultStream(pJobKey As %String) as %Stream.GlobalCharacter
Gets (a copy of) the result content stream for a job that is assumed to be complete. Throws
exceptions if there's a problem. Does not clean up (delete) the job in case further
action is planned.
@API.Method
@Argument pJobKey Job key for which we should retrieve results stream.
@Argument pJobKey Job key for which we should retrieve results stream.
classmethod JobKiller(pJobID)
classmethod PollRunningJob(pJobKey As %String, Output pResultStatus As %String, Output pErrorText As %String)
Status should be one of the status macros from HSMOD.REST.Async.inc.
If status is $$$JobError or $$$JobInternalError, there may be an "errorText" property containing error info. @API.Method
@Argument pJobKey Job key for which we should retrieve results stream.
@Argument pResultStatus Status value of job, using macro values from HSMOD.REST.Async.inc.
@Argument pErrorText Error text if applicable
If status is $$$JobError or $$$JobInternalError, there may be an "errorText" property containing error info. @API.Method
@Argument pJobKey Job key for which we should retrieve results stream.
@Argument pResultStatus Status value of job, using macro values from HSMOD.REST.Async.inc.
@Argument pErrorText Error text if applicable