本文整理汇总了Python中six.moves.queue.Queue.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Queue.__init__方法的具体用法?Python Queue.__init__怎么用?Python Queue.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类six.moves.queue.Queue
的用法示例。
在下文中一共展示了Queue.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from six.moves.queue import Queue [as 别名]
# 或者: from six.moves.queue.Queue import __init__ [as 别名]
def __init__(self, wbxmlBytes):
self.bytesDequeued = 0
self.bytesEnqueued = 0
Queue.__init__(self)
for byte in wbxmlBytes:
self.put(ord(byte))
self.bytesEnqueued += 1
logging.debug("Array byte count: %d, enqueued: %d" % (self.qsize(), self.bytesEnqueued))
示例2: __init__
# 需要导入模块: from six.moves.queue import Queue [as 别名]
# 或者: from six.moves.queue.Queue import __init__ [as 别名]
def __init__(self, size=1, maxjobs=0,
worker_factory=default_worker_factory):
if not callable(worker_factory):
raise TypeError("worker_factory must be callable")
self.worker_factory = worker_factory # Used to build new workers
self._size = 0 # Number of active workers we have
# Initialize the Queue
# The queue contains job that are read by workers
Queue.__init__(self, maxjobs)
# Pointer to the queue for backward-compatibility with version <=0.9.1
self._jobs = self
# Hire some workers!
for i in range(size):
self.grow()
示例3: __init__
# 需要导入模块: from six.moves.queue import Queue [as 别名]
# 或者: from six.moves.queue.Queue import __init__ [as 别名]
def __init__(self, maxsize=0):
self.delayed = []
Queue.__init__(self, maxsize)
self.task = DaemonTask(self._put_and_notify)