Fixed comment format (now renders properly)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
import logging
|
||||
import requests
|
||||
|
||||
"""
|
||||
Communicator module
|
||||
"""
|
||||
|
||||
import logging
|
||||
import requests
|
||||
|
||||
__author__ = "@tormakris"
|
||||
__copyright__ = "Copyright 2020, GoldenPogácsa Team"
|
||||
__module_name__ = "messagesender"
|
||||
@@ -21,6 +22,7 @@ class Communicator:
|
||||
|
||||
def __init__(self, currentconsumer: str, uuid: str):
|
||||
"""Initialize object
|
||||
|
||||
:param consumerlocator: the current consumer's IP address as a string
|
||||
:param uuid: string typed UUID.
|
||||
"""
|
||||
@@ -29,6 +31,7 @@ class Communicator:
|
||||
|
||||
def sendmessage(self, message: str) -> None:
|
||||
"""Send message to the current consumer. Logs the process.
|
||||
|
||||
:param message: the message of type string that will be sent.
|
||||
:return: None
|
||||
"""
|
||||
@@ -39,6 +42,7 @@ class Communicator:
|
||||
|
||||
def discoveravailableconsumers(self) -> list:
|
||||
"""Get the list of available consumer from the current primary consumer. Logs the received list.
|
||||
|
||||
:return: list of consumers' IP addresses
|
||||
"""
|
||||
try:
|
||||
@@ -53,6 +57,7 @@ class Communicator:
|
||||
|
||||
def isconsumeravailable(self) -> bool:
|
||||
"""Readiness probe current consumer. Logs the result.
|
||||
|
||||
:return: True if available, False otherwise
|
||||
"""
|
||||
currentconsumer = self.currenctconsumer
|
||||
@@ -67,6 +72,7 @@ class Communicator:
|
||||
|
||||
def checkconsumer(self, consumer: str) -> bool:
|
||||
"""Readiness probe of a particular consumer. Logs the result.
|
||||
|
||||
:param consumer: the consumer's IP address
|
||||
:return: True if available, False otherwise
|
||||
"""
|
||||
@@ -81,6 +87,7 @@ class Communicator:
|
||||
|
||||
def set_currentconsumer(self,currenctconsumer) -> None:
|
||||
"""Set current consumer
|
||||
|
||||
:param currenctconsumer: the consumer's IP address
|
||||
:return: None
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user