Skip to content

Commit

Permalink
added changelog and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquelino committed Dec 12, 2022
1 parent 12445e4 commit fe6dbdf
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

2022-12-11
==========

Added
-----

- The first version of the package
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

A simple package to make retry loops easier

### Usage:

```python
from retimer import Timer
import time

timer = Timer(10)
while timer.not_expired:
# do something for 10 seconds

if retry_doing_something:
time.sleep(.5) # good if something is a request to a server or cpu intensive
continue
if something_bad:
timer.explode()

# all good so we break before timer expires
break

if timer.expired:
print("Could not do something after tried for 10 seconds")
else:
print("Successfully did something after 10 seconds")

```
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ pytest = "^7.2.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[scriv]
format="md"

0 comments on commit fe6dbdf

Please sign in to comment.