Skip to content

Commit 467d01f

Browse files
committed
feat(AIP-136): prohibit "async" in custom method RPC names
1 parent 47d81dc commit 467d01f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

aip/general/0136.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ services. The bullets below apply in all three cases.
4444
- The name **must not** contain prepositions ("for", "with", etc.).
4545
- The verb in the name **should not** contain any of the standard method verbs ([Get][],
4646
[List][], [Create][], [Update][], [Delete][]).
47+
- The name **must not** include the term `Async`. Instead, if the intention is
48+
to differentiate between immediate and long-running RPCs, the suffix `LongRunning`
49+
**may** be used for this purpose. For example, to create a long-running book creation
50+
RPC (if the standard `CreateBook` method was designed before long-running aspects were
51+
considered), a custom `CreateBookLongRunning` method could be introduced.
4752
- The HTTP method **must** be `GET` or `POST`:
4853
- `GET` **must** be used for methods retrieving data or resource state.
4954
- `POST` **must** be used if the method has side effects or mutates resources
@@ -159,8 +164,19 @@ without risk of runtime impact.
159164
[update]: ./0134.md
160165
[delete]: ./0135.md
161166

167+
### RPC name
168+
169+
The term "async" is commonly used in programming languages to indicate whether
170+
a specific method call is synchronous or asynchronous, including for making RPCs.
171+
That sync/async aspect is at a different abstraction level to whether the RPC
172+
itself is intended to start a long-running operation. Using "async" within the
173+
RPC name itself causes confusion, and can even cause issues for client libraries
174+
which generate both synchronous and asynchronous methods to call the RPC in some
175+
languages.
176+
162177
## Changelog
163178

179+
- **2023-05-16:** Added prohibition of the term "async" within RPC names.
164180
- **2023-05-09:** Adding guidance for POST and GET, require parent instead of
165181
the resource singular.
166182
- **2023-03-02:** Explicitly discourage use of standard method verbs.

0 commit comments

Comments
 (0)