代码片段库

经过测试、可直接复制的 Python、Flask、JavaScript、SQL、HTML、CSS 和 Bash 代码片段,都可以在代码游乐场中打开。

2 个代码片段

javascript

Fetch JSON with a timeout

Abort a fetch that takes too long and handle HTTP errors.

intermediate #fetch#network#async
python

Retry a flaky call with exponential backoff

A decorator that retries a function on chosen exceptions, waiting longer after each failure.

intermediate #retry#decorators#network