-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document and recommend usage of the time
parameter
#18
Comments
In the Mixpanel docs, explain the use of Consumer classes to fix this. If I can implement it correctly, I'll try to send a pull request. |
Hello Diego,
That would be excellent! -Wes |
Hey Wes, sorry but I won't be able to fix this. In my project, I've used this code, in case anybody would be interested. import mixpanel
@shared_task
def async_mixpanel_consumer(consumer, endpoint, json_message):
consumer.send(endpoint, json_message)
class CeleryConsumer(object):
"""
Consumer class to Queue mixpanel.Consumer.send() into celery
"""
def __init__(self):
self.consumer = mixpanel.Consumer()
def send(self, endpoint, json_message):
async_mixpanel_consumer.delay(self.consumer, endpoint, json_message)
# Use CeleryConsumer instead of default consumer
mp = mixpanel.Mixpanel(MIXPANEL_TOKEN, CeleryConsumer())
# Then simply use the default track as the docs
mp.track(user_id, event_name, extra_props) |
That totally didn't exist when this project was created, unfortunately. |
Since the events are thrown on the queue (which might be delayed), folks should be using the
time
parameter to ensure that events are recorded as happening when they actually occurred.time param docs
The text was updated successfully, but these errors were encountered: