eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'BackgroundJob':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: BackgroundJob


Inheritance:

   Object
   |
   +--AbstractBackgroundJob
      |
      +--BackgroundJob

Package:
stx:libbasic2
Category:
System-Support-JobQueue
Version:
rev: 1.17 date: 2021/04/09 14:37:40
user: cg
file: BackgroundJob.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


A BackgroundJob for one-shot computation. When started, it performs it job
and terminates. User have to explicitly ask job to start again to 
perform new computation.


[instance variables:]

[class variables:]

copyright

COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Instance protocol:

processing
o  process
Actually perform the job. This method is called from the background worker thread

o  process: aBlock

start & stop
o  restart: aBlock
Restart the job, evaluationg aBlock instead of pre-configured job

o  start: aBlock
Start the job, evaluating aBlock instead of pre-configured `job`.

o  start: block withPriority: prio


Examples:


| job text |
job :=  BackgroundJob named: 'example job' on:[
            Delay waitForSeconds: 3.
            Transcript showCR:'One guy said: ', text
        ].
text := 'Hello world'.
job restart.
Delay waitForSeconds: 5.
text := 'Ahoj Svete!'.
job restart.
Delay waitForSeconds: 1.
text := 'Haya, I''m talking fast, you should not see the czech greeting'.
job restart.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sun, 22 Dec 2024 03:28:42 GMT