qopscribe/telegram_bot/services/redis_service.py

11 lines
313 B
Python
Raw Normal View History

2025-02-23 14:12:10 +01:00
import json
import redis
class RedisService:
def __init__(self, host: str, port: int):
self.client = redis.Redis(host=host, port=port, decode_responses=True)
def publish_task(self, task_data: dict):
channel = "audio_tasks"
self.client.publish(channel, json.dumps(task_data))