-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmessage.py
More file actions
31 lines (27 loc) · 1023 Bytes
/
message.py
File metadata and controls
31 lines (27 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""
@author: Vitor Villar <vitor.luis98@gmail.com>
"""
class Message:
data = None
private = False
message_id = None
event_type = None
retry = None
topics = None
def __init__(self, topics, data, private=False, message_id=None, event_type=None, retry=None):
"""
Defines a message
:param list topics: Which topics this message will be published
:param str data: Data itself
:param str private: To mark this update as private. (Optional)
:param str message_id: The topic's revision identifier: it will be used as the SSE's id property (Optional)
:param str event_type: The SSE's event property (a specific event type) (Optional)
:param int retry: The SSE's retry property (the reconnection time) (Optional)
"""
self.topics = topics
self.data = data
self.private = private
self.message_id = message_id
self.event_type = event_type
self.retry = retry