author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 21 Feb 2015 11:03:13 +0100 | |
changeset 3493 | e7c920efe4cc |
parent 2976 | e1da8a03d161 |
child 3505 | 148aeaa05f75 |
permissions | -rw-r--r-- |
2587 | 1 |
"{ Package: 'stx:libbasic2' }" |
2574 | 2 |
|
3493
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
4 |
|
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
5 |
AbstractBackgroundJob subclass:#BackgroundJob |
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
6 |
instanceVariableNames:'' |
2574 | 7 |
classVariableNames:'' |
8 |
poolDictionaries:'' |
|
2590 | 9 |
category:'System-Support' |
2574 | 10 |
! |
11 |
||
12 |
!BackgroundJob class methodsFor:'documentation'! |
|
13 |
||
2590 | 14 |
documentation |
15 |
" |
|
3493
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
16 |
A BackgroundJob for one-shot computation. When started, it performs it job |
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
17 |
and terminates. User have to explicitly ask job to start again to |
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
18 |
perform new computation. |
2602
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
19 |
|
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
20 |
[author:] |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
21 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
22 |
|
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
23 |
[instance variables:] |
3493
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
24 |
|
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
25 |
[class variables:] |
2602
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
26 |
|
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
27 |
[see also:] |
3493
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
28 |
BackgroundJob |
2602
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
29 |
" |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
30 |
! |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
31 |
|
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
32 |
examples |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
33 |
" |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
34 |
| job text | |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
35 |
job := BackgroundJob named: 'example job' on:[ |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
36 |
Delay waitForSeconds: 3. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
37 |
Transcript showCR:'One guy said: ', text |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
38 |
]. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
39 |
text := 'Hello world'. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
40 |
job restart. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
41 |
Delay waitForSeconds: 5. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
42 |
text := 'Ahoj Svete!!'. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
43 |
job restart. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
44 |
Delay waitForSeconds: 1. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
45 |
text := 'Haya, I''m talking fast, you should not see the czech greeting'. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
46 |
job restart. |
44d00fea6ee0
Added documentation and examples
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2590
diff
changeset
|
47 |
|
2590 | 48 |
" |
2574 | 49 |
! ! |
50 |
||
51 |
!BackgroundJob class methodsFor:'documentation'! |
|
52 |
||
2590 | 53 |
version |
3493
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
54 |
^ '$Header: /cvs/stx/stx/libbasic2/BackgroundJob.st,v 1.14 2015-02-21 10:03:13 vrany Exp $' |
2590 | 55 |
! |
56 |
||
2574 | 57 |
version_CVS |
3493
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
58 |
^ '$Header: /cvs/stx/stx/libbasic2/BackgroundJob.st,v 1.14 2015-02-21 10:03:13 vrany Exp $' |
2574 | 59 |
! |
60 |
||
61 |
version_SVN |
|
3493
e7c920efe4cc
Cleanup: introduced AbstractBackgroundJob, made all other jobs subclass of it.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2976
diff
changeset
|
62 |
^ '$Id: BackgroundJob.st,v 1.14 2015-02-21 10:03:13 vrany Exp $' |
2574 | 63 |
! ! |
2976
e1da8a03d161
use #creator instead of #signal
Claus Gittinger <cg@exept.de>
parents:
2736
diff
changeset
|
64 |