Skip to content

Commit

Permalink
Initial draft for #145.
Browse files Browse the repository at this point in the history
  • Loading branch information
cynthia committed Jul 7, 2020
1 parent d0ad23a commit 0b7057e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,20 @@ discuss.</p>
</div>


<h3 id="synchronous">Use synchronous when appropriate</h3>

Synchronous APIs should be considered when minting a new API.
Providing an API in synchronous form simplifies the usage from the caller's perspective.
Moreover, it reduces the amount of infrastructural setup overhead needed for the function call.

The general rule of thumb for an API that should be synchronous is the following:

* The API call is not expected to fail.
* The execution time is short and deterministic.

No API call is completely fail-proof; the expectation above is for the general case.


<h3 id="promises">Design asynchronous APIs using Promises</h3>

Asynchronous APIs should generally be designed using promises
Expand Down

0 comments on commit 0b7057e

Please sign in to comment.