@@ -101,25 +101,16 @@ The `Harvester` builder pattern is used to create a `Harvester` instance. The bu
101
101
- Redis monitor, for setting up monitoring from Redis
102
102
103
103
``` go
104
- h , err := New (&cfg).
105
- WithConsulSeed (" address " , " dc " , " token " ).
106
- WithConsulMonitor (" address " , " dc " , " token " ).
107
- WithRedisSeed (redisClient).
108
- WithRedisMonitor (redisClient, 10 *time.Millisecond ).
109
- Create ()
104
+ h , err := harvester. New (&cfg, chNotify,
105
+ harvester. WithConsulSeed (consulAddress, consulDC, consulToken, 0 ),
106
+ harvester. WithConsulMonitor (consulAddress, consulDC, consulToken, 0 ),
107
+ harvester. WithRedisSeed (redisClient),
108
+ harvester. WithRedisMonitor (redisClient, 200 *time.Millisecond ),
109
+ )
110
110
```
111
111
112
112
The above snippet set's up a ` Harvester ` instance with Consul and Redis seed and monitor.
113
113
114
- ## Notification support
115
-
116
- In order to be able to monitor the changes in the configuration we provide a way to notify when a change is happening via the builder.
117
-
118
- ``` go
119
- h , err := harvester.New (&cfg).WithNotification (chNotify).Create ()
120
- ...
121
- ```
122
-
123
114
## Consul
124
115
125
116
Consul has support for versioning (` ModifyIndex ` ) which allows us to change the value only if the version is higher than the one currently.
0 commit comments