public class ThreadedWorkerFactory extends Object implements WorkerFactory
WorkerFactory implementation that creates one thread for every session started, requests are then executed
in the session-specific thread.
This resolves a tricky issue where sharing threads for multiple sessions can cause complex deadlocks. It does so
at the expense of creating, potentially, many threads. However, this approach is much less complex than using
a thread pool, and is the preferred approach of several highly scalable relational databases.
If we find ourselves with tens of thousands of concurrent sessions per neo4j instance, we may want to introduce an
alternate strategy.| Constructor and Description |
|---|
ThreadedWorkerFactory(BoltFactory connector,
org.neo4j.scheduler.JobScheduler scheduler,
org.neo4j.kernel.impl.logging.LogService logging,
Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
BoltWorker |
newWorker(BoltConnectionDescriptor connectionDescriptor,
Runnable onClose) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewWorkerpublic ThreadedWorkerFactory(BoltFactory connector, org.neo4j.scheduler.JobScheduler scheduler, org.neo4j.kernel.impl.logging.LogService logging, Clock clock)
public BoltWorker newWorker(BoltConnectionDescriptor connectionDescriptor, Runnable onClose)
newWorker in interface WorkerFactoryconnectionDescriptor - describes the underlying medium (TCP, HTTP, ...)onClose - callback for closing the underlying connection in case of protocol violation.Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.