open-consul/agent/consul/state
Daniel Nephin a2f8605c66 stream: Add forceClose and refactor subscription filtering
Move the subscription context to Next. context.Context should generally
never be stored in a struct because it makes that struct only valid
while the context is valid. This is rarely obvious from the caller.
Adds a forceClosed channel in place of the old context, and uses the new
context as a way for the caller to stop the Subscription blocking.

Remove some recursion out of bufferImte.Next. The caller is already looping so we can continue
in that loop instead of recursing. This ensures currentItem is updated immediately (which probably
does not matter in practice), and also removes the chance that we overflow the stack.

NextNoBlock and FollowAfter do not need to handle bufferItem.Err, the caller already
handles it.

Moves filter to a method to simplify Next, and more explicitly separate filtering from looping.

Also improve some godoc

Only unwrap itemBuffer.Err when necessary
2020-07-14 15:57:47 -04:00
..
acl.go ProcessChanges: use stream.Event 2020-07-14 15:57:45 -04:00
acl_events.go stream: Improve docstrings 2020-07-14 15:57:47 -04:00
acl_events_test.go state: Move change processing out of EventPublisher 2020-07-14 15:57:47 -04:00
acl_oss.go state: Move change processing out of EventPublisher 2020-07-14 15:57:47 -04:00
acl_test.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
autopilot.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
autopilot_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
catalog.go Fix a bunch of unparam lint issues 2020-06-24 13:00:14 -04:00
catalog_oss.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
catalog_test.go Fix a bunch of unparam lint issues 2020-06-24 13:00:14 -04:00
config_entry.go Fix a bunch of unparam lint issues 2020-06-24 13:00:14 -04:00
config_entry_oss.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
config_entry_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
connect_ca.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
connect_ca_test.go state: track changes so that they may be used to produce change events 2020-06-16 13:04:29 -04:00
coordinate.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
coordinate_test.go Merge pull request #8034 from hashicorp/dnephin/add-linter-staticcheck-4 2020-06-17 12:16:02 -04:00
delay.go OSS KV Modifications to Support Namespaces 2019-11-25 12:57:35 -05:00
delay_test.go OSS KV Modifications to Support Namespaces 2019-11-25 12:57:35 -05:00
federation_state.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
graveyard.go Rename txnWrapper to txn 2020-06-16 13:06:02 -04:00
graveyard_oss.go Rename txnWrapper to txn 2020-06-16 13:06:02 -04:00
graveyard_test.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
index_connect.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
index_connect_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
index_service_kind.go Implement Mesh Gateways 2019-07-01 16:28:30 -04:00
intention.go connect: various changes to make namespaces for intentions work more like for other subsystems (#8194) 2020-06-26 16:59:15 -05:00
intention_oss.go connect: various changes to make namespaces for intentions work more like for other subsystems (#8194) 2020-06-26 16:59:15 -05:00
intention_test.go connect: various changes to make namespaces for intentions work more like for other subsystems (#8194) 2020-06-26 16:59:15 -05:00
kvs.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
kvs_oss.go Rename txnWrapper to txn 2020-06-16 13:06:02 -04:00
kvs_test.go Merge pull request #8034 from hashicorp/dnephin/add-linter-staticcheck-4 2020-06-17 12:16:02 -04:00
memdb.go stream: Add forceClose and refactor subscription filtering 2020-07-14 15:57:47 -04:00
operations_oss.go Rename txnWrapper to txn 2020-06-16 13:06:02 -04:00
prepared_query.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
prepared_query_index.go pkg refactor 2017-06-10 18:52:45 +02:00
prepared_query_index_test.go agent: move agent/consul/structs to agent/structs 2017-08-09 14:32:12 +02:00
prepared_query_test.go OSS Modifications necessary for sessions namespacing 2019-11-25 12:07:04 -05:00
schema.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
schema_test.go pkg refactor 2017-06-10 18:52:45 +02:00
session.go Merge pull request #8070 from hashicorp/dnephin/add-gofmt-simplify 2020-06-16 17:18:38 -04:00
session_oss.go Rename txnWrapper to txn 2020-06-16 13:06:02 -04:00
session_test.go Merge pull request #8034 from hashicorp/dnephin/add-linter-staticcheck-4 2020-06-17 12:16:02 -04:00
state_store.go state: Move change processing out of EventPublisher 2020-07-14 15:57:47 -04:00
state_store_oss_test.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
state_store_test.go Handle return value from txn.Commit 2020-06-16 13:04:31 -04:00
store_integration_test.go stream: Add forceClose and refactor subscription filtering 2020-07-14 15:57:47 -04:00
tombstone_gc.go Sheds monotonic time info so tombstone GC bins work properly. 2017-11-29 10:34:24 -08:00
tombstone_gc_test.go Sheds monotonic time info so tombstone GC bins work properly. 2017-11-29 10:34:24 -08:00
txn.go Rename txnWrapper to txn 2020-06-16 13:06:02 -04:00
txn_test.go connect: various changes to make namespaces for intentions work more like for other subsystems (#8194) 2020-06-26 16:59:15 -05:00