Skip to content

Commit 0a779fc

Browse files
author
sbragagnolo
committed
small refactors in futures
1 parent eabee82 commit 0a779fc

51 files changed

Lines changed: 3333 additions & 3319 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.smalltalk.ston

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
SmalltalkCISpec {
22
#loading : [
33
SCIMetacelloLoadSpec {
4-
#baseline : 'TaskIt',
4+
#baseline : 'ForkIt',
55
#directory : '',
66
#platforms : [ #pharo ]
77
}
88
],
99
#testing : {
1010
#include : {
11-
#packages : [ 'TaskIt.*']
11+
#packages : ['TaskItArchetype.*', 'TaskItForkIt.*', 'TaskIt.*' , 'TaskItShell.*' , 'ActIt.*' ]
1212
}
1313
}
1414
}

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ smalltalk:
1111
- Pharo64-7.0
1212
- Pharo64-8.0
1313
- Pharo32-8.0
14-
- Pharo64-9.0
15-
- Pharo32-9.0

TaskIt/BlockClosure.extension.st

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
Extension { #name : #BlockClosure }
2-
3-
{ #category : #'*TaskIt' }
4-
BlockClosure >> asTask [
5-
6-
^ TKTTask valuable: self
7-
]
8-
9-
{ #category : #'*TaskIt' }
10-
BlockClosure >> future [
11-
12-
^ self asTask future
13-
]
14-
15-
{ #category : #'*TaskIt' }
16-
BlockClosure >> schedule [
17-
18-
^ self asTask schedule
19-
]
1+
Extension { #name : #BlockClosure }
2+
3+
{ #category : #'*TaskIt' }
4+
BlockClosure >> asTask [
5+
6+
^ TKTTask valuable: self
7+
]
8+
9+
{ #category : #'*TaskIt' }
10+
BlockClosure >> future [
11+
12+
^ self asTask future
13+
]
14+
15+
{ #category : #'*TaskIt' }
16+
BlockClosure >> schedule [
17+
18+
^ self asTask schedule
19+
]

TaskIt/Dictionary.extension.st

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Extension { #name : #Dictionary }
2-
3-
{ #category : #'*TaskIt' }
4-
Dictionary >> removeKeyAtValue: aValue [
5-
| key |
6-
key := self keyAtValue: aValue ifAbsent: [ nil ].
7-
key ifNotNil: [ self removeKey: key ].
8-
^ key
9-
]
1+
Extension { #name : #Dictionary }
2+
3+
{ #category : #'*TaskIt' }
4+
Dictionary >> removeKeyAtValue: aValue [
5+
| key |
6+
key := self keyAtValue: aValue ifAbsent: [ nil ].
7+
key ifNotNil: [ self removeKey: key ].
8+
^ key
9+
]

TaskIt/MessageSend.extension.st

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : #MessageSend }
2-
3-
{ #category : #'*TaskIt' }
4-
MessageSend >> asTask [
5-
^ TKTTask valuable: self
6-
]
1+
Extension { #name : #MessageSend }
2+
3+
{ #category : #'*TaskIt' }
4+
MessageSend >> asTask [
5+
^ TKTTask valuable: self
6+
]

TaskIt/Object.extension.st

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Extension { #name : #Object }
2-
3-
{ #category : #'*TaskIt' }
4-
Object >> asWeakReference [
5-
^ (WeakArray new: 1)
6-
at: 1 put: self;
7-
yourself
8-
]
1+
Extension { #name : #Object }
2+
3+
{ #category : #'*TaskIt' }
4+
Object >> asWeakReference [
5+
^ (WeakArray new: 1)
6+
at: 1 put: self;
7+
yourself
8+
]

TaskIt/Process.extension.st

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
Extension { #name : #Process }
2-
3-
{ #category : #'*TaskIt' }
4-
Process class >> disableDebugger [
5-
6-
]
7-
8-
{ #category : #'*TaskIt' }
9-
Process class >> enableDebugger [
10-
11-
]
12-
13-
{ #category : #'*TaskIt' }
14-
Process class >> isDebuggingCompatible [
15-
^ false
16-
]
1+
Extension { #name : #Process }
2+
3+
{ #category : #'*TaskIt' }
4+
Process class >> disableDebugger [
5+
6+
]
7+
8+
{ #category : #'*TaskIt' }
9+
Process class >> enableDebugger [
10+
11+
]
12+
13+
{ #category : #'*TaskIt' }
14+
Process class >> isDebuggingCompatible [
15+
^ false
16+
]

TaskIt/SharedQueue.extension.st

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Extension { #name : #SharedQueue }
2-
3-
{ #category : #'*TaskIt' }
4-
SharedQueue >> fixedSize: aSize nextPut: anObject [
5-
monitor
6-
critical:
7-
[ [ aSize - items size < 1 ] whileTrue: [ items removeFirst ].
8-
items addLast: anObject.
9-
monitor signal ].
10-
^ anObject
11-
]
1+
Extension { #name : #SharedQueue }
2+
3+
{ #category : #'*TaskIt' }
4+
SharedQueue >> fixedSize: aSize nextPut: anObject [
5+
monitor
6+
critical:
7+
[ [ aSize - items size < 1 ] whileTrue: [ items removeFirst ].
8+
items addLast: anObject.
9+
monitor signal ].
10+
^ anObject
11+
]

TaskIt/TFinalizable.trait.st

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
Trait {
2-
#name : #TFinalizable,
3-
#category : #'TaskIt-Kernel'
4-
}
5-
6-
{ #category : #starting }
7-
TFinalizable >> noteDoesNotNeedToBeFinalized [
8-
WeakRegistry default remove: self ifAbsent: [ ]
9-
]
10-
11-
{ #category : #starting }
12-
TFinalizable >> noteNeedsToBeFinalized [
13-
WeakRegistry default add: self
14-
]
1+
Trait {
2+
#name : #TFinalizable,
3+
#category : #'TaskIt-Kernel'
4+
}
5+
6+
{ #category : #starting }
7+
TFinalizable >> noteDoesNotNeedToBeFinalized [
8+
WeakRegistry default remove: self ifAbsent: [ ]
9+
]
10+
11+
{ #category : #starting }
12+
TFinalizable >> noteNeedsToBeFinalized [
13+
WeakRegistry default add: self
14+
]
Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
1-
"
2-
I am an abstract class defining the basic behaviour and state to execute a task:
3-
- the basic executeTask: method
4-
- an exception handler meant to manage unhandled exception
5-
"
6-
Class {
7-
#name : #TKTAbstractExecutor,
8-
#superclass : #Object,
9-
#traits : 'TTaskExecutor',
10-
#classTraits : 'TTaskExecutor classTrait',
11-
#instVars : [
12-
'exceptionHandler',
13-
'busy'
14-
],
15-
#category : #'TaskIt-Kernel'
16-
}
17-
18-
{ #category : #accessing }
19-
TKTAbstractExecutor >> exceptionHandler [
20-
^ exceptionHandler
21-
]
22-
23-
{ #category : #accessing }
24-
TKTAbstractExecutor >> exceptionHandler: aHandler [
25-
26-
exceptionHandler := aHandler
27-
]
28-
29-
{ #category : #initialization }
30-
TKTAbstractExecutor >> initialize [
31-
super initialize.
32-
busy := false.
33-
exceptionHandler := TKTConfiguration errorHandler
34-
]
35-
36-
{ #category : #'as yet unclassified' }
37-
TKTAbstractExecutor >> isBusy [
38-
39-
^ busy
40-
]
41-
42-
{ #category : #'as yet unclassified' }
43-
TKTAbstractExecutor >> isFree [
44-
45-
^ busy not
46-
]
47-
48-
{ #category : #accessing }
49-
TKTAbstractExecutor >> noteBusy [
50-
51-
busy := true
52-
]
53-
54-
{ #category : #accessing }
55-
TKTAbstractExecutor >> noteFree [
56-
57-
busy := false
58-
]
59-
60-
{ #category : #polimorfism }
61-
TKTAbstractExecutor >> start [
62-
" nothing to do "
63-
]
64-
65-
{ #category : #polimorfsms }
66-
TKTAbstractExecutor >> stop [
67-
68-
]
1+
"
2+
I am an abstract class defining the basic behaviour and state to execute a task:
3+
- the basic executeTask: method
4+
- an exception handler meant to manage unhandled exception
5+
"
6+
Class {
7+
#name : #TKTAbstractExecutor,
8+
#superclass : #Object,
9+
#traits : 'TTaskExecutor',
10+
#classTraits : 'TTaskExecutor classTrait',
11+
#instVars : [
12+
'exceptionHandler',
13+
'busy'
14+
],
15+
#category : #'TaskIt-Kernel'
16+
}
17+
18+
{ #category : #accessing }
19+
TKTAbstractExecutor >> exceptionHandler [
20+
^ exceptionHandler
21+
]
22+
23+
{ #category : #accessing }
24+
TKTAbstractExecutor >> exceptionHandler: aHandler [
25+
26+
exceptionHandler := aHandler
27+
]
28+
29+
{ #category : #initialization }
30+
TKTAbstractExecutor >> initialize [
31+
super initialize.
32+
busy := false.
33+
exceptionHandler := TKTConfiguration errorHandler
34+
]
35+
36+
{ #category : #'as yet unclassified' }
37+
TKTAbstractExecutor >> isBusy [
38+
39+
^ busy
40+
]
41+
42+
{ #category : #'as yet unclassified' }
43+
TKTAbstractExecutor >> isFree [
44+
45+
^ busy not
46+
]
47+
48+
{ #category : #accessing }
49+
TKTAbstractExecutor >> noteBusy [
50+
51+
busy := true
52+
]
53+
54+
{ #category : #accessing }
55+
TKTAbstractExecutor >> noteFree [
56+
57+
busy := false
58+
]
59+
60+
{ #category : #polimorfism }
61+
TKTAbstractExecutor >> start [
62+
" nothing to do "
63+
]
64+
65+
{ #category : #polimorfsms }
66+
TKTAbstractExecutor >> stop [
67+
68+
]

0 commit comments

Comments
 (0)