From e6f4bbdcfeafc0c8a13f778278260d514daf2981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 29 Mar 2020 16:26:16 +0200 Subject: [PATCH] communicator interface done --- Dockerfile | 2 +- communicator.py | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a551683..0ca2e4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,4 @@ COPY . ./ RUN pip3 install --no-cache-dir -r requirements.txt -CMD ["python3" "app.py"] +CMD ["python3", "app.py"] diff --git a/communicator.py b/communicator.py index 38b2bf5..4c8b585 100644 --- a/communicator.py +++ b/communicator.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +import requests + """ Main Flask RESTful API """ @@ -7,4 +9,36 @@ Main Flask RESTful API __author__ = "@tormakris" __copyright__ = "Copyright 2020, GoldenPogácsa Team" __module_name__ = "messagesender" -__version__text__ = "1" \ No newline at end of file +__version__text__ = "1" + +class Communicator: + """ + Class handling low level communication with consumers. + """ + def __init__(self): + """ + Initalize class + """ + pass + + def sendmessage(self, message: str) -> None: + """ + Send message to consumer. + :param message: + :return: none + """ + pass + + def discoveravailableconsumers(self) -> list: + """ + Get the list of available consumer from the current primary consumer. + :return: + """ + pass + + def isconsumeravailable(self) -> bool: + """ + Readiness probe primary consumer. + :return: + """ + pass \ No newline at end of file