Skip to content

Commit 5537496

Browse files
committed
Update docs
1 parent 59776d3 commit 5537496

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

backend/redis/options.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,20 @@ type RedisOptions struct {
1919

2020
type RedisBackendOption func(*RedisOptions)
2121

22+
// WithKeyPrefix sets the prefix for all keys used in the Redis backend.
2223
func WithKeyPrefix(prefix string) RedisBackendOption {
2324
return func(o *RedisOptions) {
2425
o.KeyPrefix = prefix
2526
}
2627
}
2728

29+
// WithBlockTimeout sets the timeout for blocking operations like dequeuing a workflow or activity task
2830
func WithBlockTimeout(timeout time.Duration) RedisBackendOption {
2931
return func(o *RedisOptions) {
3032
o.BlockTimeout = timeout
3133
}
3234
}
3335

34-
func WithBackendOptions(opts ...backend.BackendOption) RedisBackendOption {
35-
return func(o *RedisOptions) {
36-
for _, opt := range opts {
37-
opt(&o.Options)
38-
}
39-
}
40-
}
41-
4236
// WithAutoExpiration sets the duration after which finished runs will expire from the data store.
4337
// If set to 0 (default), runs will never expire and need to be manually removed.
4438
func WithAutoExpiration(expireFinishedRunsAfter time.Duration) RedisBackendOption {
@@ -55,3 +49,11 @@ func WithAutoExpirationContinueAsNew(expireContinuedAsNewRunsAfter time.Duration
5549
o.AutoExpirationContinueAsNew = expireContinuedAsNewRunsAfter
5650
}
5751
}
52+
53+
func WithBackendOptions(opts ...backend.BackendOption) RedisBackendOption {
54+
return func(o *RedisOptions) {
55+
for _, opt := range opts {
56+
opt(&o.Options)
57+
}
58+
}
59+
}

docs/source/includes/_backends.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Create a new Redis backend instance with `NewRedisBackend`.
6868

6969
### Options
7070

71+
- `WithKeyPrefix` - Set the key prefix for all keys. Defaults to `""`
7172
- `WithBlockTimeout(timeout time.Duration)` - Set the timeout for blocking operations. Defaults to `5s`
7273
- `WithAutoExpiration(expireFinishedRunsAfter time.Duration)` - Set the expiration time for finished runs. Defaults to `0`, which never expires runs
7374
- `WithAutoExpirationContinueAsNew(expireContinuedAsNewRunsAfter time.Duration)` - Set the expiration time for continued as new runs. Defaults to `0`, which uses the same value as `WithAutoExpiration`

0 commit comments

Comments
 (0)