https://github.com/kaste/sharc
Sharded Counters on Google Appengine
https://github.com/kaste/sharc
app-engine google-appengine
Last synced: 7 months ago
JSON representation
Sharded Counters on Google Appengine
- Host: GitHub
- URL: https://github.com/kaste/sharc
- Owner: kaste
- Created: 2013-03-04T11:51:46.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-03-04T11:55:59.000Z (almost 13 years ago)
- Last Synced: 2025-05-18T19:40:45.663Z (8 months ago)
- Topics: app-engine, google-appengine
- Language: Python
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Joe Gregorio originally `posted `_ about Sharded Counters for Google Appengine.
This is like a downloadable gist::
from sharc import Counter
assert not Counter('A').exists()
Counter('A', initial_value=5, shards=5)
assert Counter('A').exists()
Counter('A').increment()
Counter('A').decrement()
Counter('A') + 2
Counter('A') - 2
assert Counter('A') == 5
Counter('A').shards = 10
Counter('A').delete() # .delete_async()
assert not Counter('A').exists()
- Added decrement
- Increment and decrement variable deltas (default=1)
- Set initial value of the counter (default=0)
- Set initial value of the num of shards (default=20)
- Added delete()