Skip to content

Commit 04ced70

Browse files
committed
Add note about sortability to docstring for 'Message.timestamp'.
1 parent ddb06db commit 04ced70

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

gcloud/pubsub/message.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ def attributes(self):
5151

5252
@property
5353
def timestamp(self):
54-
"""Return timestamp from attributes, if passed.
54+
"""Return sortable timestamp from attributes, if passed.
55+
56+
Allows sorting messages in publication order (assuming consistent
57+
clocks across all publishers).
5558
5659
:rtype: datetime
5760
:returns: timestamp (in UTC timezone) parsed from RFC 3339 timestamp
58-
:raises: ValueError if timestamp not in ``attributes``, or malformed
61+
:raises: ValueError if timestamp not in ``attributes``, or if it does
62+
not match the RFC 3339 format.
5963
"""
6064
stamp = self.attributes.get('timestamp')
6165
if stamp is None:

0 commit comments

Comments
 (0)