grpc
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

This commit is contained in:
2024-12-08 21:12:32 +03:00
parent 4b63faabef
commit 5b9c1a18b7
16 changed files with 67 additions and 106 deletions

View File

@@ -1,3 +1,18 @@
class BaseDaemon:
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 NotImplementedError
raise NotImplemented