pizda-bot/daemons/base.py
emmatveev 5b9c1a18b7
All checks were successful
Deploy Dev / Build (pull_request) Successful in 33s
Deploy Dev / Push (pull_request) Successful in 12s
Deploy Dev / Deploy dev (pull_request) Successful in 23s
grpc
2024-12-08 21:12:32 +03:00

19 lines
414 B
Python

import os
import grpc
from queues import tasks_pb2_grpc
stage = os.getenv("STAGE", 'local')
if stage == 'local':
QUEUES_URL = 'localhost:50051'
else:
QUEUES_URL = 'queues-grpc:50051'
class Daemon:
def __init__(self):
self.channel = grpc.insecure_channel(QUEUES_URL)
self.stub = tasks_pb2_grpc.TasksStub(channel=self.channel)
def execute(self):
raise NotImplemented