Hi there,
I have been working with Segment's analytics-python module for a little while now.
Today I discovered that for example the track method is asynchronous.
I never realized this before, since I usually use it within services that are always up (listeners, queues, etc)
Today I had to do a simple script to read from a file and push some data into my Segment bucket. Surprisingly when I run the super simple script the data didn't get to my Segment debugger, although when I ran the same exact code in a python console it worked like a charm.
I finally saw the problem was that my script finished before the analytics.track() function was done.
I added an extra 10 seconds to wait for it to be executed and I made sure that was the problem indeed.
So, is there anyway to make the track method wait for itself? Any extra args I could put in?
Callbacks? Any suggestions?
I took sometime to go through all the options I didn't figure out a way to do it,
any help is greatly appreciated.
Thanks for your time.
Hi there,
I have been working with Segment's analytics-python module for a little while now.
Today I discovered that for example the
trackmethod is asynchronous.I never realized this before, since I usually use it within services that are always up (listeners, queues, etc)
Today I had to do a simple script to read from a file and push some data into my Segment bucket. Surprisingly when I run the super simple script the data didn't get to my Segment debugger, although when I ran the same exact code in a python console it worked like a charm.
I finally saw the problem was that my script finished before the
analytics.track()function was done.I added an extra 10 seconds to wait for it to be executed and I made sure that was the problem indeed.
So, is there anyway to make the
trackmethod wait for itself? Any extra args I could put in?Callbacks? Any suggestions?
I took sometime to go through all the options I didn't figure out a way to do it,
any help is greatly appreciated.
Thanks for your time.