Use the Native (threading) implementation
masterThe Native implementation uses the requests library. It supports both synchronous and asynchronous execution patterns:
Synchronous calls
Use the sync() method. This returns an Envelope object which wraps both the Result and the Status. Exceptions are raised natively using the raise Exception syntax.
Asynchronous calls
Use the async() function. You must pass a callback function which will be invoked with either a response or an error.
# Example of the conceptual pattern for async calls
pubnub.async(callback_function, ...)