Communicator API impementation #1

Closed
tormakris wants to merge 4 commits from master into dev-communicator
Showing only changes of commit 48da2c1bb5 - Show all commits

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python
import random
import requests
from singleton import Singleton
@ -23,21 +24,21 @@ class Communicator(Singleton):
:param message:
:return: none
"""
pass
return None
def discoveravailableconsumers(self) -> list:
"""
Get the list of available consumer from the current primary consumer.
:return:
"""
pass
return ["10.69.42.1","10.42.69.1","10.10.10.10","10.6.66.1"]
def isconsumeravailable(self) -> bool:
"""
Readiness probe primary consumer.
:return:
"""
pass
return bool(random.getrandbits(1))
def checkconsumer(self, consumer: str) -> bool:
"""
@ -45,4 +46,4 @@ class Communicator(Singleton):
:param consumer:
:return:
"""
pass
return bool(random.getrandbits(1))