File tree 1 file changed +18
-0
lines changed
src/main/java/com/uber/cadence/samples/hello
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,24 @@ public String composeGreeting(String greeting, String name) {
74
74
75
75
public static void main (String [] args ) {
76
76
// Start a worker that hosts both workflow and activity implementations.
77
+
78
+ /**
79
+ * If you see error "Not enough threads to execute workflows" exception it indicates that there are
80
+ * not enough threads to execute currently running workflow tasks.
81
+ *
82
+ * For example, if each workflow uses two threads(using Asycn function) and maxConcurrentWorklfowExecutionSize is 100,
83
+ * and assuming the factory only creates one worker. Then maxWorkflowThreads should be at least 200.
84
+ * With such setup 0 workflows will be cached as all the threads would be consumed by the currently executing workflow tasks.
85
+ * So in general it is better to keep maxWorkflowThreads much higher than maxConcurrentWorklfowExecutionSize to support caching.
86
+ *
87
+ * maxWorkflowThreads defines how many threads all currently executing and cached workflows can use.
88
+ * It's a Factory level option, meaning that the thread pool is shared across all workers created by the factory.
89
+ *
90
+ * maxConcurrentWorklfowExecutionSize defines how many workflow tasks can execute in parallel.
91
+ * It's a worker level option.
92
+ *
93
+ *
94
+ */
77
95
Worker .Factory factory = new Worker .Factory (DOMAIN ,
78
96
new Worker .FactoryOptions .Builder ()
79
97
.setMaxWorkflowThreadCount (1000 )
You can’t perform that action at this time.
0 commit comments