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
autopilot_test.go
catalog.go Fix a bunch of unparam lint issues 2020-06-24 13:00:14 -04:00
catalog_oss.go
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
config_entry_test.go
connect_ca.go
connect_ca_test.go
coordinate.go
coordinate_test.go
delay.go
delay_test.go
federation_state.go
graveyard.go
graveyard_oss.go
graveyard_test.go
index_connect.go
index_connect_test.go
index_service_kind.go
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
kvs_oss.go
kvs_test.go
memdb.go stream: Add forceClose and refactor subscription filtering 2020-07-14 15:57:47 -04:00
operations_oss.go
prepared_query.go
prepared_query_index.go
prepared_query_index_test.go
prepared_query_test.go
schema.go
schema_test.go
session.go
session_oss.go
session_test.go
state_store.go state: Move change processing out of EventPublisher 2020-07-14 15:57:47 -04:00
state_store_oss_test.go
state_store_test.go
store_integration_test.go stream: Add forceClose and refactor subscription filtering 2020-07-14 15:57:47 -04:00
tombstone_gc.go
tombstone_gc_test.go
txn.go
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