provisioningserver.utils.twisted.ThreadPool - python examples

Here are the examples of the python api provisioningserver.utils.twisted.ThreadPool taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

3 View Complete Implementation : threads.py
Copyright GNU Affero General Public License v3.0
Author : maas
def make_default_pool(maxthreads=max_threads_for_default_pool):
    """Create a general thread-pool for non-database activity.

    Its sole consumer is the old-school web application, i.e. the plain HTTP
    service. All threads are fully connected to the database.
    """
    return ThreadPool(0, maxthreads, "default", TotallyDisconnected)

3 View Complete Implementation : threads.py
Copyright GNU Affero General Public License v3.0
Author : maas
def make_database_pool(maxthreads=max_threads_for_database_pool):
    """Create a general 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.
    All threads are fully connected to the database.
    """
    return ThreadPool(0, maxthreads, "database", FullyConnected)