@@ -58,8 +58,8 @@ func (f OptimizelyFactory) GetClient(clientOptions ...OptionFunc) *OptimizelyCli
58
58
return appClient
59
59
}
60
60
61
- // ConfigManager sets config manager on a client
62
- func ConfigManager (sdkKey string , pollingInterval time.Duration , dataFile []byte ) OptionFunc {
61
+ // PollingConfigManager sets polling config manager on a client
62
+ func PollingConfigManager (sdkKey string , pollingInterval time.Duration , dataFile []byte ) OptionFunc {
63
63
return func (f * OptimizelyClient , executionCtx utils.ExecutionCtx ) {
64
64
options := config.PollingProjectConfigManagerOptions {
65
65
Datafile : dataFile ,
@@ -69,20 +69,41 @@ func ConfigManager(sdkKey string, pollingInterval time.Duration, dataFile []byte
69
69
}
70
70
}
71
71
72
- // DecisionService sets decision service on a client
73
- func DecisionService (notificationCenter notification.Center ) OptionFunc {
72
+ // ConfigManager sets polling config manager on a client
73
+ func ConfigManager (configManager optimizely.ProjectConfigManager ) OptionFunc {
74
+ return func (f * OptimizelyClient , executionCtx utils.ExecutionCtx ) {
75
+ f .configManager = configManager
76
+ }
77
+ }
78
+
79
+ // CompositeDecisionService sets decision service on a client
80
+ func CompositeDecisionService (notificationCenter notification.Center ) OptionFunc {
74
81
return func (f * OptimizelyClient , executionCtx utils.ExecutionCtx ) {
75
82
f .decisionService = decision .NewCompositeService (notificationCenter )
76
83
}
77
84
}
78
85
79
- // EventProcessor sets event processor on a client
80
- func EventProcessor (batchSize , queueSize int , flushInterval time.Duration ) OptionFunc {
86
+ // DecisionService sets decision service on a client
87
+ func DecisionService (decisionService decision.Service ) OptionFunc {
88
+ return func (f * OptimizelyClient , executionCtx utils.ExecutionCtx ) {
89
+ f .decisionService = decisionService
90
+ }
91
+ }
92
+
93
+ // BatchEventProcessor sets event processor on a client
94
+ func BatchEventProcessor (batchSize , queueSize int , flushInterval time.Duration ) OptionFunc {
81
95
return func (f * OptimizelyClient , executionCtx utils.ExecutionCtx ) {
82
96
f .eventProcessor = event .NewEventProcessor (executionCtx , batchSize , queueSize , flushInterval )
83
97
}
84
98
}
85
99
100
+ // EventProcessor sets event processor on a client
101
+ func EventProcessor (eventProcessor event.Processor ) OptionFunc {
102
+ return func (f * OptimizelyClient , executionCtx utils.ExecutionCtx ) {
103
+ f .eventProcessor = eventProcessor
104
+ }
105
+ }
106
+
86
107
// StaticClient returns a client initialized with a static project config
87
108
func (f OptimizelyFactory ) StaticClient () (* OptimizelyClient , error ) {
88
109
var configManager optimizely.ProjectConfigManager
0 commit comments