[Mod]统一使用queue
This commit is contained in:
parent
d7ee0c3448
commit
325717a9c6
@ -10,7 +10,7 @@ import hmac
|
||||
import time
|
||||
from datetime import datetime
|
||||
from time import time, sleep , mktime
|
||||
from Queue import Queue, Empty
|
||||
from queue import Queue, Empty
|
||||
from threading import Thread
|
||||
import urllib
|
||||
import websocket
|
||||
|
@ -11,7 +11,7 @@ import hmac
|
||||
import time
|
||||
from datetime import datetime
|
||||
from time import time, sleep , mktime
|
||||
from Queue import Queue, Empty
|
||||
from queue import Queue, Empty
|
||||
from threading import Thread
|
||||
import urllib
|
||||
import websocket
|
||||
|
@ -10,7 +10,7 @@ import hmac
|
||||
import time
|
||||
from datetime import datetime
|
||||
from time import time, sleep , mktime
|
||||
from Queue import Queue, Empty
|
||||
from queue import Queue, Empty
|
||||
from threading import Thread
|
||||
import urllib
|
||||
|
||||
|
@ -9,7 +9,7 @@ import json
|
||||
from datetime import datetime
|
||||
from copy import copy
|
||||
from threading import Condition
|
||||
from Queue import Queue
|
||||
from queue import Queue
|
||||
from threading import Thread
|
||||
|
||||
import json
|
||||
|
@ -9,7 +9,7 @@ import json
|
||||
from datetime import datetime
|
||||
from copy import copy
|
||||
from threading import Condition
|
||||
from Queue import Queue
|
||||
from queue import Queue
|
||||
from threading import Thread
|
||||
|
||||
import json
|
||||
|
@ -10,7 +10,7 @@ from datetime import datetime
|
||||
from time import sleep
|
||||
from copy import copy
|
||||
from threading import Condition
|
||||
from Queue import Queue
|
||||
from queue import Queue
|
||||
from threading import Thread
|
||||
from time import sleep
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from __future__ import print_function
|
||||
import zmq
|
||||
import Queue
|
||||
import queue
|
||||
import threading
|
||||
import msgpack
|
||||
import snappy
|
||||
@ -37,7 +37,7 @@ class JRpcServer :
|
||||
self._should_close = False
|
||||
self._send_lock = threading.Lock()
|
||||
|
||||
self._callback_queue = Queue.Queue()
|
||||
self._callback_queue = queue.Queue()
|
||||
|
||||
self._ctx = zmq.Context()
|
||||
self._pull_sock = self._ctx.socket(zmq.PULL)
|
||||
@ -121,7 +121,7 @@ class JRpcServer :
|
||||
r = self._callback_queue.get(timeout = 1)
|
||||
if r :
|
||||
r()
|
||||
except Queue.Empty as e:
|
||||
except queue.Empty as e:
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
|
@ -9,10 +9,7 @@ import zmq
|
||||
import time
|
||||
import random
|
||||
|
||||
try:
|
||||
import queue
|
||||
except ImportError:
|
||||
import queue as queue
|
||||
import queue
|
||||
import threading
|
||||
import msgpack
|
||||
import snappy
|
||||
|
@ -10,10 +10,7 @@ from builtins import *
|
||||
|
||||
import zmq
|
||||
|
||||
try:
|
||||
import queue
|
||||
except ImportError:
|
||||
import queue as queue
|
||||
import queue
|
||||
import threading
|
||||
import msgpack
|
||||
import snappy
|
||||
|
@ -8,7 +8,7 @@ import json
|
||||
import traceback
|
||||
|
||||
import requests
|
||||
from Queue import Queue, Empty
|
||||
from queue import Queue, Empty
|
||||
from threading import Thread
|
||||
from multiprocessing.dummy import Pool
|
||||
from time import time
|
||||
|
@ -13,7 +13,7 @@ import copy
|
||||
import traceback
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime, timedelta, time
|
||||
from Queue import Queue, Empty
|
||||
from queue import Queue, Empty
|
||||
from threading import Thread
|
||||
from pymongo.errors import DuplicateKeyError
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user