19 lines
402 B
Python
19 lines
402 B
Python
import os
|
|
import grpc
|
|
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
|