semvec/pypi-packages huggingface dataset:
redis-semaphore-eval 0.3.0
A redis semaphore implementation using eval scripts
License: MIT
Requires Python: >=3.6.1,<4.0.0
Keywords: redis,semaphore,lock

# Redis Semaphore Eval

[![codecov](https://codecov.io/gh/wakemaster39/redis-semaphore-eval/branch/master/graph/badge.svg?token=BHTUPI4A0A)](https://codecov.io/gh/wakemaster39/redis-semaphore-eval)
[![Actions Status](https://github.com/wakemaster39/redis-semaphore-eval/workflows/Tests/badge.svg)](https://github.comwakemaster39/redis-semaphore-eval/actions)
[![Version](https://img.shields.io/pypi/v/redis-semaphore-eval)](https://pypi.org/project/redis-semaphore-eval/)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/redis-semaphore-eval.svg)](https://pypi.org/project/redis-semaphore-eval/)
[![Pyversions](https://img.shields.io/pypi/pyversions/redis-semaphore-eval.svg)](https://pypi.org/project/redis-semaphore-eval/)

https://redislabs.com/ebook/part-2-core-concepts/chapter-6-application-components-in-redis/6-3-counting-semaphores/

## Usage
To acquire a lock:
```python
from redis import Redis
from redis_semaphore_eval import semaphore

redis = Redis(host="localhost", port=6379, db=0)
key = "unique_lock_key"
with semaphore(redis, key=key, limit=2, expire_in=5, timeout=1) as lock_id:
    ...
```

To acquire a lock but continuously renew it in a background thread:
```python
from redis import Redis
from redis_semaphore_eval import auto_renewing_semaphore

redis = Redis(host="localhost", port=6379, db=0)
key = "unique_lock_key"
with auto_renewing_semaphore(
    redis,
    key=key,
    limit=2,
    expire_in=5,
    timeout=1,
    auto_renewal_interval=4
) as lock_id:
    ...
```



## Contributing

```bash
poetry run pre-commit install -t pre-commit -t commit-msg && poetry run pre-commit run --all
docker-compose up -d
poetry run python -m pytest
docker-compose down
```
axyloop 1.0
Makes infinite for loops in python much easier, faster and cleaner
License: MIT
Keywords: forloop

NOTE: Please import the library as from axyloop import * 
otherwise the library will not work!

This is a very simple library by IAmAxY that makes infinite for loop in python
easier, faster and cleaner.
The library lets you to create infinite 4 loops easier and faster and keeps your code clean.
How to use it? 
Type axy_loop_help() in your code and you will see all the examples and ussages printed in the terminal / console
Or you can look the examples here:

USAGE:
1. axy_loop(action)
2. axy_loop_sleep(sleep_time_in_seconds, action)
3. axy_loop_sleep_fps(fps_amount, action)

USAGE EXAMPLES:
1. axy_loop("Subscribe To IAmAxY On YouTube!") - to create infinite for loop that will print Subscribe To IAmAxY On YouTube!
2. axy_loop_sleep(5, "Subscribe To IAmAxY On YouTube!") - to create infinite for loop that will print Subscribe To IAmAxY On YouTube! one every 5 seconds
3. axy_loop_sleep_fps(30, "Subscribe To IAmAxY On YouTube!") - to create infinite for loop that will print Subscribe To IAmAxY On YouTube! 30 times in 1 second

Follow me:
YouTube - http://axy-youtube.tk
Steam - http://axysteam.tk
Discord server - https://dsc.gg/axy

contacts:
Gmail - iamaxydev@gmail.com
Discord (might change) - AxY#5945

Thanks for installing / using my library!

Change Log
==========

1 (17/5/2021)
--------------
- First And Probably Last Release