platypush/platypush/message/event/ping.py

33 lines
790 B
Python
Raw Normal View History

2019-12-27 23:26:39 +01:00
from platypush.message.event import Event
2018-01-02 00:48:41 +01:00
class PingEvent(Event):
2018-07-09 22:37:54 +02:00
""" Ping event, used for testing purposes """
2018-01-02 00:48:41 +01:00
def __init__(self, message=None, *args, **kwargs):
2018-07-09 22:37:54 +02:00
"""
:param message: Ping message
:type message: object
"""
2018-01-02 00:48:41 +01:00
super().__init__(message=message, *args, **kwargs)
2019-12-27 23:26:39 +01:00
class HostDownEvent(Event):
"""
Event triggered when a remote host stops responding ping requests.
"""
def __init__(self, host: str, *args, **kwargs):
super().__init__(host=host, *args, **kwargs)
class HostUpEvent(Event):
"""
Event triggered when a remote host starts responding ping requests.
"""
def __init__(self, host: str, *args, **kwargs):
super().__init__(host=host, *args, **kwargs)
2018-01-02 00:48:41 +01:00
2019-12-27 23:26:39 +01:00
# vim:sw=4:ts=4:et: