From ff904987dbd8167c5d10c717369260362fdb26b7 Mon Sep 17 00:00:00 2001 From: Devendra Date: Mon, 21 Jul 2014 12:13:33 +0530 Subject: [fixes #74743948] added daemon flag, for core python pubnub class --- Pubnub.py | 4 ++++ 1 file changed, 4 insertions(+) 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(): -- cgit v1.2.3