当前位置: 首页>>代码示例>>Python>>正文


Python Queue.access方法代码示例

本文整理汇总了Python中multiprocessing.Queue.access方法的典型用法代码示例。如果您正苦于以下问题:Python Queue.access方法的具体用法?Python Queue.access怎么用?Python Queue.access使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在multiprocessing.Queue的用法示例。


在下文中一共展示了Queue.access方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Queue

# 需要导入模块: from multiprocessing import Queue [as 别名]
# 或者: from multiprocessing.Queue import access [as 别名]
# using options.config in run.py (python -m emissary.run -c somefile.py)
app.config.from_object("emissary.config")

app.version = "2.0.0"
app.inbox = Queue()
app.scripts     = None
app.feedmanager = None
app.config["HTTP_BASIC_AUTH_REALM"] = "Emissary " + app.version


# These are response queues that enable the main thread of execution to
# share data with the REST interface. Mainly for reporting the status of crontabs.
app.queues = []
for i in range(cpu_count() * 2):
	q = Queue()
	q.access = time.time()
	app.queues.append(q)

db = SQLAlchemy(app)
api = restful.Api(app, prefix='/v1')

def init():
	# Models are imported here to prevent a circular import where we would
	# import models and the models would import that db object just above us.

	# They're also imported here in this function because they implicitly
	# monkey-patch the threading module, and we might not need that if all we want
	# from the namespace is something like app.version, like in repl.py for example.
	from models import APIKey
	from models import FeedGroup
	from models import Feed
开发者ID:nivertech,项目名称:Emissary,代码行数:33,代码来源:__init__.py


注:本文中的multiprocessing.Queue.access方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。