class SIMPLE_BACKGROUND_JOB

Features exported to LOOP_ITEM

Describe job to be executed in the background, when there nothing more important to do. Such job is ready to run at any time.

Direct parents

conformant parents

BACKGROUND_JOB

Summary

creation features

exported features

Details

set_work (t: FUNCTION [O_ -> TUPLE, R_][TUPLEBOOLEAN], tr: PROCEDURE [O_ -> TUPLE][TUPLE], prio: INTEGER)

t has to return True while continue

require

  • t /= Void

ensure

  • priority = prio

set_work (t: FUNCTION [O_ -> TUPLE, R_][TUPLEBOOLEAN], tr: PROCEDURE [O_ -> TUPLE][TUPLE], prio: INTEGER)

t has to return True while continue

require

  • t /= Void

ensure

  • priority = prio

done: BOOLEAN

done returns True when the job is finished. Then the job may be restart(ed) if it need to run again.

continue

Continue to do the job The work to do has to be small work and non blocking, it will continue on next call

restart

Configure the job like the initial state. Example: when some window dialog appears second time, all jobs from this window are restarted.

require

  • done

ensure

  • not done

prepare (ready: READY_DESCRIPTION)

use ready to descibe condition that make this job ready to continue.

require

  • ready /= Void
  • not ready.queryable

is_ready (ready: READY_DESCRIPTION): BOOLEAN

check if this job is ready to continue his work

require

  • ready /= Void
  • ready.queryable

priority: INTEGER

Never change priority after job inserted in loop_item. Priority should only be set at creation time.

< (other: JOB): BOOLEAN

Class invariant