backend / app /core /video_queue.py
Monteeq CI
๐Ÿš€ Initial deployment of Monteeq backend
3533fb9
Raw History Blame Contribute Delete
642 Bytes
import json
from app.core.redis import redis_client
class VideoQueue:
def __init__(self):
self.redis = redis_client
self.queue_name = "video_tasks"
def push_task(self, video_id: str, task_id: str, target_format: str = "home"):
"""
Pushes a video transcoding task to the Redis queue for the Rust worker.
"""
task_data = {
"video_id": str(video_id),
"task_id": str(task_id),
"target_format": target_format
}
self.redis.lpush(self.queue_name, json.dumps(task_data))
return task_id
# Global instance
video_queue = VideoQueue()