You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-13
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@ This library provides the ability to cancel asynchronous tasks. Cancelling async
4
4
5
5
> The following are some architectural observations provided by **Dean Tribble** on the [es-discuss mailing list](https://mail.mozilla.org/pipermail/es-discuss/2015-March/041887.html):
6
6
>
7
-
> *Cancel requests, not results*
7
+
> _Cancel requests, not results_
8
8
>
9
9
> Promises are like object references for async; any particular promise might
10
10
> be returned or passed to more than one client. Usually, programmers would
11
11
> be surprised if a returned or passed in reference just got ripped out from
12
-
> under them *by another client*. this is especially obvious when considering
12
+
> under them _by another client_. this is especially obvious when considering
13
13
> a library that gets a promise passed into it. Using "cancel" on the promise
14
14
> is like having delete on object references; it's dangerous to use, and
15
15
> unreliable to have used by others.
16
16
>
17
-
> *Cancellation is heterogeneous*
17
+
> _Cancellation is heterogeneous_
18
18
>
19
19
> It can be misleading to think about canceling a single activity. In most
20
20
> systems, when cancellation happens, many unrelated tasks may need to be
@@ -23,14 +23,14 @@ This library provides the ability to cancel asynchronous tasks. Cancelling async
23
23
> happen?
24
24
>
25
25
> - the async fetch of more query results should be terminated and the
26
-
> connection closed
26
+
> connection closed
27
27
> - background computation to process the remote results into renderable
28
-
> form should be stopped
28
+
> form should be stopped
29
29
> - rendering of not-yet rendered content should be stopped. this might
30
-
> include retrieval of secondary content for the items no longer of interest
31
-
> (e.g., album covers for the songs found by a complicated content search)
30
+
> include retrieval of secondary content for the items no longer of interest
31
+
> (e.g., album covers for the songs found by a complicated content search)
32
32
> - the animation of "loading more" should be stopped, and should be
33
-
> replaced with "user cancelled"
33
+
> replaced with "user cancelled"
34
34
> - etc.
35
35
>
36
36
> Some of these are different levels of abstraction, and for any non-trivial
@@ -41,7 +41,7 @@ This library provides the ability to cancel asynchronous tasks. Cancelling async
41
41
> get passed the one that would be cancelled if the user hits stop and the
42
42
> right thing happens.
43
43
>
44
-
> *Cancellation should be smart*
44
+
> _Cancellation should be smart_
45
45
>
46
46
> Libraries can and should be smart about how they cancel. In the case of an
47
47
> async query, once the result of a query from the server has come back, it
@@ -54,7 +54,7 @@ This library provides the ability to cancel asynchronous tasks. Cancelling async
54
54
> worker complete (so that you can reuse it) rather than abruptly terminate
55
55
> it (requiring discarding of the running worker and cached state).
56
56
>
57
-
> *Cancellation is a race*
57
+
> _Cancellation is a race_
58
58
>
59
59
> In an async system, new activities may be getting continuously scheduled by
60
60
> asks that are themselves scheduled but not currently running. The act of
@@ -70,7 +70,7 @@ This library provides the ability to cancel asynchronous tasks. Cancelling async
70
70
> system), but that schedules work that will be cancelled (parse the
71
71
> publication of an update to the now-cancelled query).
72
72
>
73
-
> *Cancellation is "don't care"*
73
+
> _Cancellation is "don't care"_
74
74
>
75
75
> Because smart cancellation sometimes doesn't stop anything and in an async
76
76
> environment, cancellation is racing with progress, it is at most "best
@@ -82,7 +82,7 @@ This library provides the ability to cancel asynchronous tasks. Cancelling async
82
82
> and transactions. It was amazing how much simpler cancellation logic
83
83
> becomes when it's "don't care".
84
84
>
85
-
> *Cancellation requires separation of concerns*
85
+
> _Cancellation requires separation of concerns_
86
86
>
87
87
> In the pattern where more than one thing gets cancelled, the source of the
88
88
> cancellation is rarely one of the things to be cancelled. It would be a
@@ -92,7 +92,7 @@ This library provides the ability to cancel asynchronous tasks. Cancelling async
92
92
> cancellation token and cancellation source mirrors that separation between
93
93
> a promise and it's resolver.
94
94
>
95
-
> *Cancellation recovery is transient*
95
+
> _Cancellation recovery is transient_
96
96
>
97
97
> As a task progresses, the cleanup action may change. In the example above,
98
98
> if the data table requests more results upon scrolling, it's cancellation
0 commit comments