aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevendra2014-07-21 12:13:33 +0530
committerDevendra2014-07-21 12:13:33 +0530
commitff904987dbd8167c5d10c717369260362fdb26b7 (patch)
treef5e59ca132eaf274be8dfd24eb164d42c60cf6a4
parent1ecaa93e2ec929ca8ebc185dbdde46d649da7534 (diff)
downloadpubnub-python-ff904987dbd8167c5d10c717369260362fdb26b7.tar.bz2
[fixes #74743948] added daemon flag, for core python pubnub class
-rw-r--r--Pubnub.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Pubnub.py b/Pubnub.py
index ef857d2..0871616 100644
--- a/Pubnub.py
+++ b/Pubnub.py
@@ -1346,6 +1346,7 @@ class Pubnub(PubnubCore):
origin='pubsub.pubnub.com',
uuid=None,
pooling=True,
+ daemon=False,
pres_uuid=None
):
super(Pubnub, self).__init__(
@@ -1372,12 +1373,14 @@ class Pubnub(PubnubCore):
self.latest_sub_callback_lock = threading.RLock()
self.latest_sub_callback = {'id': None, 'callback': None}
self.pnsdk = 'PubNub-Python' + '/' + self.version
+ self.daemon = daemon
def timeout(self, interval, func):
def cb():
time.sleep(interval)
func()
thread = threading.Thread(target=cb)
+ thread.daemon = self.daemon
thread.start()
def _request_async(self, request, callback=None, error=None, single=False, timeout=5):
@@ -1397,6 +1400,7 @@ class Pubnub(PubnubCore):
callback=callback, error=error, timeout=timeout)
thread = threading.Thread(target=client.run)
+ thread.daemon = self.daemon
thread.start()
def abort():