-
Notifications
You must be signed in to change notification settings - Fork 1
Job
do- edited this page Dec 28, 2022
·
94 revisions
Job is a class of single-use objects created for each execution of a business method (from Application's ModuleMap).
Its name means "jobs" in Queueing theory, not Oracle Database's periodic tasks.
This class implements the basic workflow used in all doix based server applications. It's presumed to never be inherited from, only extended by setting event handlers.
Job instances are mostly passive objects: other pieces of code get and set their properties, subscribe to events and so on. Only two methods are exposed to be called from elsewhere.
| Name | Description |
|---|---|
app |
the Application instance this job belongs to |
rq |
request parameters, an an Object. Think PHP's $_REQUEST generalization. Setting rq is the way of passing parameters to the business method to be called in the context of this job. |
result |
the result returned by the business method and to be returned by toComplete (). But result event handlers may rewrite it. |
error |
the error thrown by the business method and to be thrown by toComplete (). But error event handlers may rewrite it. In particular, if this.error finally gets undefined, toComplete () returns undefined instead of throwing anything. |