https://github.com/snower/pyslock
slock python client
https://github.com/snower/pyslock
Last synced: 10 months ago
JSON representation
slock python client
- Host: GitHub
- URL: https://github.com/snower/pyslock
- Owner: snower
- License: mit
- Created: 2018-07-26T09:21:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T09:13:31.000Z (over 4 years ago)
- Last Synced: 2024-12-24T22:33:16.575Z (over 1 year ago)
- Language: Python
- Size: 29.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyslock
High-performance distributed sync service and atomic DB. Provides good multi-core support through lock queues, high-performance asynchronous binary network protocols. Can be used for spikes, synchronization, event notification, concurrency control. https://github.com/snower/slock
# Install
```bash
pip install pyslock
```
# Event
```python
import redis
import pyslock
slock_client = pyslock.Client("localhost")
event = slock_client.Event("test", 5, 120, False)
event.set()
```
```python
import asyncio
import pyslock
async def run():
slock_client = pyslock.AsyncClient("localhost")
event = slock_client.Event("test", 5, 120, False)
await event.set()
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
```
# License
slock uses the MIT license, see LICENSE file for the details.