mixpanel-py-async 0.0.2

This library allows for using the Mixpanel python client in anasynchronous way. Using the AsyncBufferedConsumer, events sent to theMixpanel API will be batched and then flushed in a thread withoutblocking the main thread. This is extremely useful in a request/responsescenario where response time is important.

This library was originally created for use at`Clef <https: getclef.com="">`__ and is in production use there.

These events will be batched and then sent in a seperate, asynchronousthread.

Configuration~~~~~~~~~~~~~

For most users, the default configuration should work perfectly. Formore specific needs, AsyncBufferedConsumer has a variety ofconfiguration options, which you can use to manage how it batches andsends API requests.

- ``flush_after (datetime.timedelta)`` - *defaults to 10 seconds* - the time period after which the AsyncBufferedConsumer will flush the events upon receiving a new event (no matter what the event queue size is)

- ``max_size (int)`` - *defaults to 20* - how big a given event queue can get before it is flushed by the consumer

- ``events_url (str)`` - *defaults to standard Mixpanel API URL* - the Mixpanel API URL that track events will be sent to

- ``people_url (str)`` - *defaults to standard Mixpanel API URL* - the Mixpanel API URL that people events will be sent to

Usage~~~~~

Typically, after configuring the AsyncBufferedConsumer and passing it tothe Mixpanel object, you will never have to use it again. That said,there are a few methods which can be useful.

- ``flush()`` - tells the AsyncBufferedConsumer to flush all of the events in its queues. If you call it with ``async=False`` this flush will happen in the main thread (useful for ensuring all events are sent before a process ends)

Writing code and participating should be fun, not an exercise in perseverance. Stringent commit polices, for whatever their other qualities may bring, also mean longer turnaround times.

Submit a patch and once it's accepted, you'll get commit access to therepository. Feel free to fork the repository and send a pull request,once it's merged in you'll get added. If not, feel free to bug`jessepollak <http: github.com="" jessepollak="">`__ about it.