Package com.caplin.motif
Class ThreadMode.SharedThreads
- java.lang.Object
-
- com.caplin.motif.ThreadMode.SharedThreads
-
- All Implemented Interfaces:
ThreadMode
- Enclosing interface:
- ThreadMode
public static final class ThreadMode.SharedThreads extends java.lang.Object implements ThreadMode
Will provide each trade an executor which will be shared by many trades. Assignment is round-robin. Trade listeners must be asynchronous and must not block one another.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.caplin.motif.ThreadMode
ThreadMode.NewThread, ThreadMode.ScheduledExecutorWrapper, ThreadMode.SharedThreads
-
-
Constructor Summary
Constructors Constructor Description SharedThreads()
Uses a default number of threads for the pool, which is equal to the number of available processors.SharedThreads(int threadPoolSize)
Allows the user to customise the number of threads for the pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThreadMode.ScheduledExecutorWrapper
getScheduledExecutorWrapper()
java.lang.String
toString()
-
-
-
Constructor Detail
-
SharedThreads
public SharedThreads()
Uses a default number of threads for the pool, which is equal to the number of available processors.
-
SharedThreads
public SharedThreads(int threadPoolSize)
Allows the user to customise the number of threads for the pool.- Parameters:
threadPoolSize
- The number of threads to keep in the pool.
-
-
Method Detail
-
getScheduledExecutorWrapper
public ThreadMode.ScheduledExecutorWrapper getScheduledExecutorWrapper()
- Specified by:
getScheduledExecutorWrapper
in interfaceThreadMode
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-