Agent: Add docstrings to notify_relay_on_propagation

This commit is contained in:
Mike Salvatore 2022-10-03 13:24:09 -04:00
parent d3ff56138f
commit a8383f4a79
1 changed files with 12 additions and 0 deletions

View File

@ -8,10 +8,22 @@ logger = logging.getLogger(__name__)
class notify_relay_on_propagation:
"""
Notifies a TCPRelay of potential relay users if propagation is successful
"""
def __init__(self, tcp_relay: Optional[TCPRelay]):
"""
:param tcp_relay: A TCPRelay to notify on successful propagation
"""
self._tcp_relay = tcp_relay
def __call__(self, event: PropagationEvent):
"""
Notify a TCPRelay of potential relay users if propagation is successful
:param event: A `PropagationEvent`
"""
if self._tcp_relay is None:
return