OverviewSingleDeprecated

jsx3.util

class Job

Object
->jsx3.util.GNode
  ->jsx3.util.Job

All Implemented Interfaces:

jsx3.util.EventDispatcher

class Job
extends jsx3.util.GNode
No description provided.

Since:

3.6

Field Summary
static int
DONE
Value that the run() method may return to indicate that the job has finished and any dependent jobs should be run immediately.
static String
FINISH
Event subject published when this job finishes.
static int
FINISHED
Value for the state property indicating that this job has finished.
static int
PUSH
Value that the run() method may return to indicate that the job should be put back on the waiting job queue.
static int
SLEEP
Value that the run() method may return to indicate that the job has finished and any dependent jobs should be run after breaking the JavaScript stack with window.setTimeout().
static int
WAIT
Value that the run() method may return to indicate that the job will not finish until the finish() method is called.
static int
WAITING
Value for the state property indicating that this job has not yet finished.
Constructor Summary
void
init(id : String, fctRun : ?)
The instance initializer.
Method Summary
void
A job should call this method on itself if its run() method returns WAIT to communicate to the job manager that it has finished.
int
run()
Runs the job.
void
Returns the job state.
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.util.GNode
add, del, down, graph, id, up
Methods Inherited From Object
toString
Field Detail

DONE

static final int DONE
Value that the run() method may return to indicate that the job has finished and any dependent jobs should be run immediately.

FINISH

static final String FINISH
Event subject published when this job finishes.

FINISHED

static final int FINISHED
Value for the state property indicating that this job has finished.

PUSH

static final int PUSH
Value that the run() method may return to indicate that the job should be put back on the waiting job queue.

SLEEP

static final int SLEEP
Value that the run() method may return to indicate that the job has finished and any dependent jobs should be run after breaking the JavaScript stack with window.setTimeout().

WAIT

static final int WAIT
Value that the run() method may return to indicate that the job will not finish until the finish() method is called.

WAITING

static final int WAITING
Value for the state property indicating that this job has not yet finished.
Constructor Detail

init

void init(id : String, fctRun : ?)
The instance initializer.

Parameters:

idthe unique job id. If this parameter is not provided, a suitable unique value is generated.
fctRun
Method Detail

finish

void finish()
A job should call this method on itself if its run() method returns WAIT to communicate to the job manager that it has finished.

See Also:

WAIT

run

int run()
Runs the job. This method should be overridden for any job that wants to perform some action.

Returns:

WAIT, DONE, or SLEEP

See Also:

WAIT, DONE, SLEEP

state

void state()
Returns the job state.

Returns:

WAITING or FINISHED

See Also:

WAITING, FINISHED