[Mod]统一使用queue

This commit is contained in:
cooooo 2018-08-28 21:56:32 +08:00
parent d7ee0c3448
commit 325717a9c6
11 changed files with 13 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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