Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anistark/redis-scheduler
Scheduler
https://github.com/anistark/redis-scheduler
aws-sqs boto3 handler multiprocessing python-3 queue redis redis-scheduler schedule scheduler sqs
Last synced: 14 days ago
JSON representation
Scheduler
- Host: GitHub
- URL: https://github.com/anistark/redis-scheduler
- Owner: anistark
- License: mit
- Created: 2017-02-19T17:20:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-14T11:24:25.000Z (about 7 years ago)
- Last Synced: 2024-10-12T09:16:41.908Z (26 days ago)
- Topics: aws-sqs, boto3, handler, multiprocessing, python-3, queue, redis, redis-scheduler, schedule, scheduler, sqs
- Language: Python
- Size: 28.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RedisScheduler
[![license](https://img.shields.io/github/license/anistark/redis-scheduler.svg)](https://github.com/anistark/redis-scheduler/blob/master/LICENSE) [![pypi](https://img.shields.io/pypi/v/RedisScheduler.svg)](https://pypi.python.org/pypi/RedisScheduler)
## Install via pip
```
pip install RedisScheduler
```## Usage
```
from RedisScheduler.RedisScheduler import RedisScheduler
```### Start Listening
Initialise RedisScheduler
```
listener = RedisScheduler()
```Set SQS keys
```
listener.set_sqs_keys(access_key='', secret_key='', queue_name='emails', region='ap-south-1')
```Start Listening
```
listener.start_listening(handler='sqs')
```### Registering your event
```
setter = RedisScheduler()
``````
key = str(int(time()))
``````
value = json.dumps({'time': time(), 'foo':{'bar': 'foo', 'baz': 3, 'bor': {'foo':'bar', 'bar': 'foo'}}})
```#### Scheduled time for the event in iso format with timestamp
```
scheduled_time = '2017-02-25T12:30:00+05:30'
```### Register the event to be scheduled
Register your event
```
setter.register_event(value, scheduled_time)
```Modify your registered event
```
setter.modify_event(key, value, scheduled_time)
```#### Contributions welcome for more handlers and enhancements. Contribution document coming soon.