Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
cin
- Fri, 14 Oct 2016 00:33:17
Show More
0
.hgtags
.hgtags
created
644
+1
0
0
Implab/AbstractPromise.cs
Implab/AbstractPromise.cs
+4
-6
@@
-27,10
+27,8
namespace Implab {
27
27
if (( m_mask & PromiseEventType . Success ) != 0 && m_handler != null ) {
28
28
try {
29
29
m_handler ();
30
} catch ( Exception err ) {
31
// avoid calling handler twice in case of error
32
if ( m_error != null )
33
SignalError ( err );
30
// Analysis disable once EmptyGeneralCatchClause
31
} catch {
34
32
}
35
33
}
36
34
}
@@
-55,8
+53,8
namespace Implab {
55
53
if ( m_cancel != null ) {
56
54
try {
57
55
m_cancel ( reason );
58
} catch ( Exception err ) {
59
SignalError(err);
56
// Analysis disable once EmptyGeneralCatchClause
57
} catch {
60
58
}
61
59
} else if ( ( m_mask & PromiseEventType . Cancelled ) != 0 && m_handler != null ) {
62
60
try {
0
Implab/AbstractPromiseT.cs
Implab/AbstractPromiseT.cs
+6
-8
@@
-39,16
+39,14
namespace Implab {
39
39
if ( m_success != null ) {
40
40
try {
41
41
m_success ( result );
42
} catch ( Exception err ) {
43
SignalError(err);
42
// Analysis disable once EmptyGeneralCatchClause
43
} catch {
44
44
}
45
45
} else if (( m_mask & PromiseEventType . Success ) != 0 && m_handler != null ) {
46
46
try {
47
47
m_handler ();
48
} catch ( Exception err ) {
49
// avoid calling handler twice in case of error
50
if ( m_error != null )
51
SignalError ( err );
48
// Analysis disable once EmptyGeneralCatchClause
49
} catch {
52
50
}
53
51
}
54
52
}
@@
-73,8
+71,8
namespace Implab {
73
71
if ( m_cancel != null ) {
74
72
try {
75
73
m_cancel ( reason );
76
} catch ( Exception err ) {
77
SignalError(err);
74
// Analysis disable once EmptyGeneralCatchClause
75
} catch {
78
76
}
79
77
} else if (( m_mask & PromiseEventType . Cancelled ) != 0 && m_handler != null ) {
80
78
try {
0
Implab/ActionChainTask.cs
Implab/ActionChainTask.cs
+1
-3
@@
-23,10
+23,8
namespace Implab {
23
23
var p = m_task ();
24
24
p . On ( SetResult , HandleErrorInternal , HandleCancelInternal );
25
25
CancellationRequested ( p . Cancel );
26
} catch ( OperationCanceledException reason ){
27
HandleCancelInternal ( reason );
28
26
} catch ( Exception err ) {
29
HandleErrorInternal( err );
27
Set ErrorInternal( err );
30
28
}
31
29
}
32
30
}
0
Implab/ActionChainTaskBase.cs
Implab/ActionChainTaskBase.cs
+3
-3
@@
-36,10
+36,10
namespace Implab {
36
36
// отдавать ли результат или подтвердить отмену (или вернуть ошибку).
37
37
CancellationRequested ( p . Cancel );
38
38
} catch ( Exception err ) {
39
HandleErrorInternal( err );
39
Set ErrorInternal( err );
40
40
}
41
41
} else {
42
HandleErrorInternal ( reason ?? new OperationCanceledException ());
42
SetCancelledInternal ( reason );
43
43
}
44
44
}
45
45
@@
-50,7
+50,7
namespace Implab {
50
50
p . On ( SetResult , SetErrorInternal , SetCancelledInternal );
51
51
CancellationRequested ( p . Cancel );
52
52
} catch ( Exception err ) {
53
SetErrorInternal ( error );
53
SetErrorInternal ( err );
54
54
}
55
55
} else {
56
56
SetErrorInternal ( error );
0
Implab/ActionChainTaskT.cs
Implab/ActionChainTaskT.cs
+1
-3
@@
-14,10
+14,8
namespace Implab {
14
14
var p = m_task ( value );
15
15
p . On ( SetResult , HandleErrorInternal , HandleCancelInternal );
16
16
CancellationRequested ( p . Cancel );
17
} catch ( OperationCanceledException reason ) {
18
HandleCancelInternal ( reason );
19
17
} catch ( Exception err ) {
20
HandleErrorInternal( err );
18
Set ErrorInternal( err );
21
19
}
22
20
}
23
21
}
0
Implab/ActionTask.cs
Implab/ActionTask.cs
+1
-3
@@
-12,10
+12,8
namespace Implab {
12
12
try {
13
13
m_task ();
14
14
SetResult ();
15
} catch ( OperationCanceledException reason ) {
16
HandleCancelInternal ( reason );
17
15
} catch ( Exception err ) {
18
HandleErrorInternal( err );
16
Set ErrorInternal( err );
19
17
}
20
18
}
21
19
}
0
Implab/ActionTaskBase.cs
Implab/ActionTaskBase.cs
+2
-2
@@
-42,10
+42,10
namespace Implab {
42
42
m_cancel ( error );
43
43
SetResult ();
44
44
} catch ( Exception err ) {
45
HandleErrorInternal( err );
45
Set ErrorInternal( err );
46
46
}
47
47
} else {
48
HandleErrorInternal ( error ?? new OperationCanceledException ());
48
SetCancelledInternal ( error );
49
49
}
50
50
}
51
51
}
0
Implab/ActionTaskT.cs
Implab/ActionTaskT.cs
+1
-3
@@
-12,10
+12,8
namespace Implab {
12
12
try {
13
13
m_task ( value );
14
14
SetResult ();
15
} catch ( OperationCanceledException reason ) {
16
HandleCancelInternal ( reason );
17
15
} catch ( Exception err ) {
18
HandleErrorInternal( err );
16
Set ErrorInternal( err );
19
17
}
20
18
}
21
19
}
0
Implab/Components/RunnableComponent.cs
Implab/Components/RunnableComponent.cs
+17
-10
@@
-120,6
+120,20
namespace Implab.Components {
120
120
121
121
prev = m_pending ;
122
122
123
Action < Exception > errorOrCancel = e => {
124
if ( e == null )
125
e = new OperationCanceledException ();
126
127
lock ( m_stateMachine ) {
128
if ( m_pending == promise ) {
129
Move ( Commands . Fail );
130
m_pending = null ;
131
m_lastError = e ;
132
}
133
}
134
throw new PromiseTransientException ( e );
135
};
136
123
137
promise = task . Then (
124
138
() => {
125
139
lock ( m_stateMachine ) {
@@
-128,16
+142,9
namespace Implab.Components {
128
142
m_pending = null ;
129
143
}
130
144
}
131
}, e => {
132
lock ( m_stateMachine ) {
133
if ( m_pending == promise ) {
134
Move ( Commands . Fail );
135
m_pending = null ;
136
m_lastError = e ;
137
}
138
}
139
throw new PromiseTransientException ( e );
140
}
145
},
146
errorOrCancel ,
147
errorOrCancel
141
148
);
142
149
143
150
m_pending = promise ;
0
Implab/FuncChainTask.cs
Implab/FuncChainTask.cs
+1
-3
@@
-15,10
+15,8
namespace Implab {
15
15
var operation = m_task ();
16
16
operation . On ( SetResult , HandleErrorInternal , HandleCancelInternal );
17
17
CancellationRequested ( operation . Cancel );
18
} catch ( OperationCanceledException reason ) {
19
HandleCancelInternal ( reason );
20
18
} catch ( Exception err ) {
21
HandleErrorInternal( err );
19
Set ErrorInternal( err );
22
20
}
23
21
}
24
22
}
0
Implab/FuncChainTaskBase.cs
Implab/FuncChainTaskBase.cs
+2
-2
@@
-43,10
+43,10
namespace Implab {
43
43
p . On ( SetResult , HandleErrorInternal , SetCancelledInternal );
44
44
CancellationRequested ( p . Cancel );
45
45
} catch ( Exception err ) {
46
HandleErrorInternal( err );
46
Set ErrorInternal( err );
47
47
}
48
48
} else {
49
HandleErrorInternal ( reason ?? new OperationCanceledException ());
49
SetCancelledInternal ( reason );
50
50
}
51
51
}
52
52
}
0
Implab/FuncChainTaskT.cs
Implab/FuncChainTaskT.cs
+1
-3
@@
-14,10
+14,8
namespace Implab {
14
14
var operation = m_task ( value );
15
15
operation . On ( SetResult , HandleErrorInternal , SetCancelled );
16
16
CancellationRequested ( operation . Cancel );
17
} catch ( OperationCanceledException reason ) {
18
HandleCancelInternal ( reason );
19
17
} catch ( Exception err ) {
20
HandleErrorInternal( err );
18
Set ErrorInternal( err );
21
19
}
22
20
}
23
21
}
0
Implab/FuncTask.cs
Implab/FuncTask.cs
+1
-3
@@
-13,10
+13,8
namespace Implab {
13
13
if ( m_task != null && LockCancelation ()) {
14
14
try {
15
15
SetResult ( m_task ());
16
} catch ( OperationCanceledException reason ) {
17
HandleCancelInternal ( reason );
18
16
} catch ( Exception err ) {
19
HandleErrorInternal( err );
17
Set ErrorInternal( err );
20
18
}
21
19
}
22
20
}
0
Implab/FuncTaskBase.cs
Implab/FuncTaskBase.cs
+2
-2
@@
-40,10
+40,10
namespace Implab {
40
40
try {
41
41
SetResult ( m_cancel ( reason ));
42
42
} catch ( Exception err ) {
43
HandleErrorInternal( err );
43
Set ErrorInternal( err );
44
44
}
45
45
} else {
46
HandleErrorInternal ( reason ?? new OperationCanceledException ());
46
SetCancelledInternal ( reason );
47
47
}
48
48
}
49
49
0
Implab/FuncTaskT.cs
Implab/FuncTaskT.cs
+1
-3
@@
-12,10
+12,8
namespace Implab {
12
12
if ( m_task != null && LockCancelation ()) {
13
13
try {
14
14
SetResult ( m_task ( value ));
15
} catch ( OperationCanceledException reason ) {
16
HandleCancelInternal ( reason );
17
15
} catch ( Exception err ) {
18
HandleErrorInternal( err );
16
Set ErrorInternal( err );
19
17
}
20
18
}
21
19
}
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages