@@ -17,7 +17,11 @@ import "github.com/dapr/go-sdk/actor/codec/constant"
17
17
18
18
// ActorConfig is Actor's configuration struct.
19
19
type ActorConfig struct {
20
- SerializerType string
20
+ SerializerType string
21
+ IdleTimeout string
22
+ ScanInterval string
23
+ DrainOngingCallTimeout string
24
+ DrainBalancedActors bool
21
25
}
22
26
23
27
// Option is option function of ActorConfig.
@@ -30,6 +34,34 @@ func WithSerializerName(serializerType string) Option {
30
34
}
31
35
}
32
36
37
+ // WithIdleTimeout set serializer type of the actor as @idleTimeout.
38
+ func WithIdleTimeout (idleTimeout string ) Option {
39
+ return func (config * ActorConfig ) {
40
+ config .IdleTimeout = idleTimeout
41
+ }
42
+ }
43
+
44
+ // WithScanInterval set serializer type of the actor as @scanInterval.
45
+ func WithScanInterval (scanInterval string ) Option {
46
+ return func (config * ActorConfig ) {
47
+ config .ScanInterval = scanInterval
48
+ }
49
+ }
50
+
51
+ // WithDrainOngingCallTimeout set serializer type of the actor as @drainOngingCallTimeout.
52
+ func WithDrainOngingCallTimeout (drainOngingCallTimeout string ) Option {
53
+ return func (config * ActorConfig ) {
54
+ config .DrainOngingCallTimeout = drainOngingCallTimeout
55
+ }
56
+ }
57
+
58
+ // WithDrainBalancedActors set serializer type of the actor as @drainBalancedActors.
59
+ func WithDrainBalancedActors (drainBalancedActors bool ) Option {
60
+ return func (config * ActorConfig ) {
61
+ config .DrainBalancedActors = drainBalancedActors
62
+ }
63
+ }
64
+
33
65
// GetConfigFromOptions get final ActorConfig set by @opts.
34
66
func GetConfigFromOptions (opts ... Option ) * ActorConfig {
35
67
conf := & ActorConfig {
0 commit comments