@@ -74,9 +74,9 @@ public static final class Builder {
74
74
private boolean usingVirtualThreadsOnNexusWorker ;
75
75
private String identity ;
76
76
private WorkerDeploymentOptions deploymentOptions ;
77
- private PollerBehavior workflowTaskPollersBehaviour ;
78
- private PollerBehavior activityTaskPollersBehaviour ;
79
- private PollerBehavior nexusTaskPollersBehaviour ;
77
+ private PollerBehavior workflowTaskPollersBehavior ;
78
+ private PollerBehavior activityTaskPollersBehavior ;
79
+ private PollerBehavior nexusTaskPollersBehavior ;
80
80
81
81
private Builder () {}
82
82
@@ -109,9 +109,9 @@ private Builder(WorkerOptions o) {
109
109
this .usingVirtualThreadsOnLocalActivityWorker = o .usingVirtualThreadsOnLocalActivityWorker ;
110
110
this .usingVirtualThreadsOnNexusWorker = o .usingVirtualThreadsOnNexusWorker ;
111
111
this .deploymentOptions = o .deploymentOptions ;
112
- this .workflowTaskPollersBehaviour = o .workflowTaskPollersBehaviour ;
113
- this .activityTaskPollersBehaviour = o .activityTaskPollersBehaviour ;
114
- this .nexusTaskPollersBehaviour = o .nexusTaskPollersBehaviour ;
112
+ this .workflowTaskPollersBehavior = o .workflowTaskPollersBehavior ;
113
+ this .activityTaskPollersBehavior = o .activityTaskPollersBehavior ;
114
+ this .nexusTaskPollersBehavior = o .nexusTaskPollersBehavior ;
115
115
}
116
116
117
117
/**
@@ -500,22 +500,22 @@ public Builder setDeploymentOptions(WorkerDeploymentOptions deploymentOptions) {
500
500
* well.
501
501
*/
502
502
@ Experimental
503
- public Builder setWorkflowTaskPollersBehaviour (PollerBehavior pollerBehavior ) {
504
- this .workflowTaskPollersBehaviour = pollerBehavior ;
503
+ public Builder setWorkflowTaskPollersBehavior (PollerBehavior pollerBehavior ) {
504
+ this .workflowTaskPollersBehavior = pollerBehavior ;
505
505
return this ;
506
506
}
507
507
508
508
/** Set the poller behavior for activity task pollers. */
509
509
@ Experimental
510
- public Builder setActivityTaskPollersBehaviour (PollerBehavior pollerBehavior ) {
511
- this .activityTaskPollersBehaviour = pollerBehavior ;
510
+ public Builder setActivityTaskPollersBehavior (PollerBehavior pollerBehavior ) {
511
+ this .activityTaskPollersBehavior = pollerBehavior ;
512
512
return this ;
513
513
}
514
514
515
515
/** Set the poller behavior for nexus task pollers. */
516
516
@ Experimental
517
- public Builder setNexusTaskPollersBehaviour (PollerBehavior pollerBehavior ) {
518
- this .nexusTaskPollersBehaviour = pollerBehavior ;
517
+ public Builder setNexusTaskPollersBehavior (PollerBehavior pollerBehavior ) {
518
+ this .nexusTaskPollersBehavior = pollerBehavior ;
519
519
return this ;
520
520
}
521
521
@@ -546,9 +546,9 @@ public WorkerOptions build() {
546
546
usingVirtualThreadsOnLocalActivityWorker ,
547
547
usingVirtualThreadsOnNexusWorker ,
548
548
deploymentOptions ,
549
- workflowTaskPollersBehaviour ,
550
- activityTaskPollersBehaviour ,
551
- nexusTaskPollersBehaviour );
549
+ workflowTaskPollersBehavior ,
550
+ activityTaskPollersBehavior ,
551
+ nexusTaskPollersBehavior );
552
552
}
553
553
554
554
public WorkerOptions validateAndBuildWithDefaults () {
@@ -608,6 +608,22 @@ public WorkerOptions validateAndBuildWithDefaults() {
608
608
Preconditions .checkState (
609
609
maxConcurrentNexusTaskPollers >= 0 , "negative maxConcurrentNexusTaskPollers" );
610
610
611
+ if (workflowTaskPollersBehavior != null ) {
612
+ Preconditions .checkState (
613
+ maxConcurrentWorkflowTaskPollers == 0 ,
614
+ "workflowTaskPollersBehavior and maxConcurrentWorkflowTaskPollers are mutually exclusive" );
615
+ }
616
+ if (activityTaskPollersBehavior != null ) {
617
+ Preconditions .checkState (
618
+ maxConcurrentActivityTaskPollers == 0 ,
619
+ "activityTaskPollersBehavior and maxConcurrentActivityTaskPollers are mutually exclusive" );
620
+ }
621
+ if (nexusTaskPollersBehavior != null ) {
622
+ Preconditions .checkState (
623
+ maxConcurrentNexusTaskPollers == 0 ,
624
+ "nexusTaskPollersBehavior and maxConcurrentNexusTaskPollers are mutually exclusive" );
625
+ }
626
+
611
627
return new WorkerOptions (
612
628
maxWorkerActivitiesPerSecond ,
613
629
maxConcurrentActivityExecutionSize == 0
@@ -658,9 +674,9 @@ public WorkerOptions validateAndBuildWithDefaults() {
658
674
usingVirtualThreadsOnLocalActivityWorker ,
659
675
usingVirtualThreadsOnNexusWorker ,
660
676
deploymentOptions ,
661
- workflowTaskPollersBehaviour ,
662
- activityTaskPollersBehaviour ,
663
- nexusTaskPollersBehaviour );
677
+ workflowTaskPollersBehavior ,
678
+ activityTaskPollersBehavior ,
679
+ nexusTaskPollersBehavior );
664
680
}
665
681
}
666
682
@@ -689,9 +705,9 @@ public WorkerOptions validateAndBuildWithDefaults() {
689
705
private final boolean usingVirtualThreadsOnLocalActivityWorker ;
690
706
private final boolean usingVirtualThreadsOnNexusWorker ;
691
707
private final WorkerDeploymentOptions deploymentOptions ;
692
- private PollerBehavior workflowTaskPollersBehaviour ;
693
- private PollerBehavior activityTaskPollersBehaviour ;
694
- private PollerBehavior nexusTaskPollersBehaviour ;
708
+ private final PollerBehavior workflowTaskPollersBehavior ;
709
+ private final PollerBehavior activityTaskPollersBehavior ;
710
+ private final PollerBehavior nexusTaskPollersBehavior ;
695
711
696
712
private WorkerOptions (
697
713
double maxWorkerActivitiesPerSecond ,
@@ -719,9 +735,9 @@ private WorkerOptions(
719
735
boolean virtualThreadsEnabledOnLocalActivityWorker ,
720
736
boolean virtualThreadsEnabledOnNexusWorker ,
721
737
WorkerDeploymentOptions deploymentOptions ,
722
- PollerBehavior workflowTaskPollersBehaviour ,
723
- PollerBehavior activityTaskPollersBehaviour ,
724
- PollerBehavior nexusTaskPollersBehaviour ) {
738
+ PollerBehavior workflowTaskPollersBehavior ,
739
+ PollerBehavior activityTaskPollersBehavior ,
740
+ PollerBehavior nexusTaskPollersBehavior ) {
725
741
this .maxWorkerActivitiesPerSecond = maxWorkerActivitiesPerSecond ;
726
742
this .maxConcurrentActivityExecutionSize = maxConcurrentActivityExecutionSize ;
727
743
this .maxConcurrentWorkflowTaskExecutionSize = maxConcurrentWorkflowTaskExecutionSize ;
@@ -747,9 +763,9 @@ private WorkerOptions(
747
763
this .usingVirtualThreadsOnLocalActivityWorker = virtualThreadsEnabledOnLocalActivityWorker ;
748
764
this .usingVirtualThreadsOnNexusWorker = virtualThreadsEnabledOnNexusWorker ;
749
765
this .deploymentOptions = deploymentOptions ;
750
- this .workflowTaskPollersBehaviour = workflowTaskPollersBehaviour ;
751
- this .activityTaskPollersBehaviour = activityTaskPollersBehaviour ;
752
- this .nexusTaskPollersBehaviour = nexusTaskPollersBehaviour ;
766
+ this .workflowTaskPollersBehavior = workflowTaskPollersBehavior ;
767
+ this .activityTaskPollersBehavior = activityTaskPollersBehavior ;
768
+ this .nexusTaskPollersBehavior = nexusTaskPollersBehavior ;
753
769
}
754
770
755
771
public double getMaxWorkerActivitiesPerSecond () {
@@ -870,16 +886,16 @@ public WorkerDeploymentOptions getDeploymentOptions() {
870
886
return deploymentOptions ;
871
887
}
872
888
873
- public PollerBehavior getWorkflowTaskPollersBehaviour () {
874
- return workflowTaskPollersBehaviour ;
889
+ public PollerBehavior getWorkflowTaskPollersBehavior () {
890
+ return workflowTaskPollersBehavior ;
875
891
}
876
892
877
- public PollerBehavior getActivityTaskPollersBehaviour () {
878
- return activityTaskPollersBehaviour ;
893
+ public PollerBehavior getActivityTaskPollersBehavior () {
894
+ return activityTaskPollersBehavior ;
879
895
}
880
896
881
- public PollerBehavior getNexusTaskPollersBehaviour () {
882
- return nexusTaskPollersBehaviour ;
897
+ public PollerBehavior getNexusTaskPollersBehavior () {
898
+ return nexusTaskPollersBehavior ;
883
899
}
884
900
885
901
@ Override
@@ -912,9 +928,9 @@ && compare(maxTaskQueueActivitiesPerSecond, that.maxTaskQueueActivitiesPerSecond
912
928
&& usingVirtualThreadsOnLocalActivityWorker == that .usingVirtualThreadsOnLocalActivityWorker
913
929
&& usingVirtualThreadsOnNexusWorker == that .usingVirtualThreadsOnNexusWorker
914
930
&& Objects .equals (deploymentOptions , that .deploymentOptions )
915
- && Objects .equals (workflowTaskPollersBehaviour , that .workflowTaskPollersBehaviour )
916
- && Objects .equals (activityTaskPollersBehaviour , that .activityTaskPollersBehaviour )
917
- && Objects .equals (nexusTaskPollersBehaviour , that .nexusTaskPollersBehaviour );
931
+ && Objects .equals (workflowTaskPollersBehavior , that .workflowTaskPollersBehavior )
932
+ && Objects .equals (activityTaskPollersBehavior , that .activityTaskPollersBehavior )
933
+ && Objects .equals (nexusTaskPollersBehavior , that .nexusTaskPollersBehavior );
918
934
}
919
935
920
936
@ Override
@@ -945,9 +961,9 @@ public int hashCode() {
945
961
usingVirtualThreadsOnLocalActivityWorker ,
946
962
usingVirtualThreadsOnNexusWorker ,
947
963
deploymentOptions ,
948
- workflowTaskPollersBehaviour ,
949
- activityTaskPollersBehaviour ,
950
- nexusTaskPollersBehaviour );
964
+ workflowTaskPollersBehavior ,
965
+ activityTaskPollersBehavior ,
966
+ nexusTaskPollersBehavior );
951
967
}
952
968
953
969
@ Override
@@ -1004,12 +1020,12 @@ public String toString() {
1004
1020
+ usingVirtualThreadsOnNexusWorker
1005
1021
+ ", deploymentOptions="
1006
1022
+ deploymentOptions
1007
- + ", workflowTaskPollersBehaviour ="
1008
- + workflowTaskPollersBehaviour
1009
- + ", activityTaskPollersBehaviour ="
1010
- + activityTaskPollersBehaviour
1011
- + ", nexusTaskPollersBehaviour ="
1012
- + nexusTaskPollersBehaviour
1023
+ + ", workflowTaskPollersBehavior ="
1024
+ + workflowTaskPollersBehavior
1025
+ + ", activityTaskPollersBehavior ="
1026
+ + activityTaskPollersBehavior
1027
+ + ", nexusTaskPollersBehavior ="
1028
+ + nexusTaskPollersBehavior
1013
1029
+ '}' ;
1014
1030
}
1015
1031
}
0 commit comments