WIP: flow rewrite #138

Draft
vtolstov wants to merge 3 commits from dag into v3
3 changed files with 12 additions and 3 deletions
Showing only changes of commit fa817c707b - Show all commits

View File

@ -15,7 +15,7 @@ jobs:
steps: steps:
- name: metadata - name: metadata
id: metadata id: metadata
uses: dependabot/fetch-metadata@v1.3.1 uses: dependabot/fetch-metadata@v1.3.3
with: with:
github-token: "${{ secrets.TOKEN }}" github-token: "${{ secrets.TOKEN }}"
- name: merge - name: merge

View File

@ -301,11 +301,11 @@ func TestWatcher(t *testing.T) {
wg.Add(1) wg.Add(1)
go func() { go func() {
for { for {
ch, err := wc.Next() _, err := wc.Next()
if err != nil { if err != nil {
t.Fatal("unexpected err", err) t.Fatal("unexpected err", err)
} }
t.Logf("changes %#+v", ch.Service) // t.Logf("changes %#+v", ch.Service)
wc.Stop() wc.Stop()
wg.Done() wg.Done()
return return

View File

@ -34,6 +34,8 @@ type Options struct {
Addrs []string Addrs []string
// Wrappers store wrapper that called before actual functions // Wrappers store wrapper that called before actual functions
// Wrappers []Wrapper // Wrappers []Wrapper
// Timeout specifies timeout duration for all operations
Timeout time.Duration
} }
// NewOptions creates options struct // NewOptions creates options struct
@ -110,6 +112,13 @@ func Tracer(t tracer.Tracer) Option {
} }
} }
// Timeout sets the timeout
func Timeout(td time.Duration) Option {
return func(o *Options) {
o.Timeout = td
}
}
// Addrs contains the addresses or other connection information of the backing storage. // Addrs contains the addresses or other connection information of the backing storage.
// For example, an etcd implementation would contain the nodes of the cluster. // For example, an etcd implementation would contain the nodes of the cluster.
// A SQL implementation could contain one or more connection strings. // A SQL implementation could contain one or more connection strings.