Skip to content

Commit

Permalink
Adding timestamp to client event
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermef committed Dec 24, 2020
1 parent acbdfa5 commit 9e55405
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tornado_eventsource/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

__version__ = '2.0.0rc2'
__version__ = '2.0.0rc3'
4 changes: 4 additions & 0 deletions tornado_eventsource/event_source_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import collections
import re
import datetime

from tornado import simple_httpclient
from tornado.ioloop import IOLoop
Expand Down Expand Up @@ -38,6 +39,9 @@ def __init__(self):
self.data = None
self.id = None
self.retry = None
self.timestamp = int(
datetime.datetime.utcnow().timestamp() * 1000
)

def __repr__(self):
return "Event<%s,%s,%s>" % (str(self.id), str(self.name), str(self.data))
Expand Down

0 comments on commit 9e55405

Please sign in to comment.