| Total Complexity | 3 | 
| Total Lines | 38 | 
| Duplicated Lines | 0 % | 
| Coverage | 0% | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | """ | ||
| 11 | class HaltMessage(Message): | ||
| 12 | """ | ||
| 13 | Message type for instructing a daemon of Enarksh to halt. | ||
| 14 | """ | ||
| 15 | MESSAGE_TYPE = 'HaltMessage' | ||
| 16 | """ | ||
| 17 | The message type. | ||
| 18 | |||
| 19 | :type: str | ||
| 20 | """ | ||
| 21 | |||
| 22 | # ------------------------------------------------------------------------------------------------------------------ | ||
| 23 | def __init__(self): | ||
| 24 | """ | ||
| 25 | Object constructor. | ||
| 26 | """ | ||
| 27 | Message.__init__(self, HaltMessage.MESSAGE_TYPE) | ||
| 28 | |||
| 29 | # ------------------------------------------------------------------------------------------------------------------ | ||
| 30 | @staticmethod | ||
| 31 | def create_message(_): | ||
| 32 | """ | ||
| 33 | Create a message of this class based on JSON data. | ||
| 34 | |||
| 35 | :rtype: enarksh.message.HaltMessage.HaltMessage | ||
| 36 | """ | ||
| 37 | return HaltMessage() | ||
| 38 | |||
| 39 | # ------------------------------------------------------------------------------------------------------------------ | ||
| 40 | def send_message(self, end_point): | ||
| 41 | """ | ||
| 42 | Sends the message to an end point. | ||
| 43 | |||
| 44 | :param str end_point: The end point. | ||
| 45 | |||
| 46 | :rtype: None | ||
| 47 | """ | ||
| 48 | self.message_controller.send_message(end_point, self) | ||
| 49 | |||
| 51 |