Skip to content

Commit d5d73be

Browse files
jasnellRenegade334
andauthored
Update doc/contributing/erm-guidelines.md
Co-authored-by: René <[email protected]>
1 parent afd2a37 commit d5d73be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/contributing/erm-guidelines.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ So with this is mind, it is necessary to outline some guidelines for disposers:
132132
criteria is not met, then the disposer is actually a synchronous disposer in
133133
disguise, and will block the execution thread until it returns; such a
134134
disposer should instead be declared using `Symbol.dispose`.
135-
7. Avoid, as much as possible, using both `Symbol.dispose` and `Symbl.asyncDispose`
135+
7. Because the disposal process is strictly ordered, there is an intrinsic
136+
expectation that all tasks performed by a single disposer are fully complete
137+
at the point that the disposer returns. This means, for example, that
138+
"callback-style" APIs must not be invoked within a disposer, unless they are
139+
promisified and awaited. Any Promise created within a disposer must be
140+
awaited, to ensure its resolution prior to the disposer returning.
141+
8. Avoid, as much as possible, using both `Symbol.dispose` and `Symbol.asyncDispose`
136142
in the same object. This can make it difficult to reason about which method
137143
will be called in a given context and could lead to unexpected behavior or
138144
subtle bugs. This is not a firm rule, however. Sometimes it may make sense

0 commit comments

Comments
 (0)