def make_database_unpool(maxthreads=max_threads_for_database_pool):
"""Create a general non-thread-pool for database activity.
Its consumer are the old-school web application, i.e. the plain HTTP and
HTTP API services, and the WebSocket service, for the responsive web UI.
Each thread is fully connected to the database.
However, this is a :class:`ThreadUnpool`, which means that threads are not
actually pooled: a new thread is created for each task. This is ideal for
testing, to improve isolation between tests.
"""
return ThreadUnpool(DeferredSemaphore(maxthreads), ExclusivelyConnected)
评论列表
文章目录