open-consul/agent/consul
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
..
authmethod Fix a bunch of unparam lint issues 2020-06-24 13:00:14 -04:00
autopilot
discoverychain Enable gofmt simplify 2020-06-16 13:21:11 -04:00
fsm connect: various changes to make namespaces for intentions work more like for other subsystems (#8194) 2020-06-26 16:59:15 -05:00
prepared_query Enable gofmt simplify 2020-06-16 13:21:11 -04:00
state stream: Add forceClose and refactor subscription filtering 2020-07-14 15:57:47 -04:00
stream stream: Add forceClose and refactor subscription filtering 2020-07-14 15:57:47 -04:00
testdata
wanfed
acl.go Remove ACLsEnabled from delegate interface 2020-07-03 17:00:20 -04:00
acl_authmethod.go ACL Node Identities (#7970) 2020-06-16 12:54:27 -04:00
acl_authmethod_oss.go
acl_authmethod_test.go
acl_client.go Remove ACLsEnabled from delegate interface 2020-07-03 17:00:20 -04:00
acl_endpoint.go Merge pull request #8237 from hashicorp/dnephin/remove-acls-enabled-from-delegate 2020-07-09 16:35:43 -04:00
acl_endpoint_legacy.go Merge pull request #8237 from hashicorp/dnephin/remove-acls-enabled-from-delegate 2020-07-09 16:35:43 -04:00
acl_endpoint_oss.go
acl_endpoint_test.go ci: Add ineffsign linter 2020-06-16 17:32:50 -04:00
acl_oss.go
acl_oss_test.go
acl_replication.go
acl_replication_legacy.go
acl_replication_legacy_test.go
acl_replication_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
acl_replication_types.go
acl_server.go Remove ACLsEnabled from delegate interface 2020-07-03 17:00:20 -04:00
acl_server_oss.go
acl_test.go Remove ACLsEnabled from delegate interface 2020-07-03 17:00:20 -04:00
acl_token_exp.go Remove ACLsEnabled from delegate interface 2020-07-03 17:00:20 -04:00
acl_token_exp_test.go
auto_config_endpoint.go Pass the Config and TLS Configurator into the AutoConfig constructor 2020-07-08 12:36:11 -04:00
auto_config_endpoint_test.go Pass the Config and TLS Configurator into the AutoConfig constructor 2020-07-08 12:36:11 -04:00
auto_encrypt.go Fix auto_encrypt IP/DNS SANs 2020-06-30 09:59:07 -04:00
auto_encrypt_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
auto_encrypt_endpoint_test.go
auto_encrypt_test.go Fix auto_encrypt IP/DNS SANs 2020-06-30 09:59:07 -04:00
autopilot.go
autopilot_oss.go
autopilot_test.go
catalog_endpoint.go Set enterprise metadata after resolving the token (#8302) 2020-07-13 13:39:57 -05:00
catalog_endpoint_test.go agent/consul: Add support for NotModified to two endpoints 2020-07-02 17:05:46 -04:00
client.go Remove ACLsEnabled from delegate interface 2020-07-03 17:00:20 -04:00
client_serf.go
client_test.go Merge pull request #7966 from hashicorp/pool_improvements 2020-06-04 08:56:26 +02:00
cluster_test.go
config.go Implement the insecure version of the Cluster.AutoConfig RPC endpoint 2020-06-17 11:25:29 -04:00
config_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
config_endpoint_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
config_replication.go
config_replication_test.go
connect_ca_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
connect_ca_endpoint_test.go
consul_ca_delegate.go
coordinate_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
coordinate_endpoint_test.go
discovery_chain_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
discovery_chain_endpoint_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
enterprise_client_oss.go
enterprise_config_oss.go
enterprise_server_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
federation_state_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
federation_state_endpoint_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
federation_state_replication.go server: don't activate federation state replication or anti-entropy until all servers are running 1.8.0+ (#8014) 2020-06-04 16:05:27 -05:00
federation_state_replication_test.go
filter.go
filter_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
flood.go
gateway_locator.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
gateway_locator_test.go
health_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
health_endpoint_test.go
helper_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
intention_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
intention_endpoint_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
internal_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
internal_endpoint_test.go Move compound service names to use ServiceName type 2020-06-12 13:47:43 -06:00
issue_test.go
kvs_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
kvs_endpoint_test.go ci: Enabled SA2002 staticcheck check 2020-06-05 17:50:11 -04:00
leader.go Remove ACLsEnabled from delegate interface 2020-07-03 17:00:20 -04:00
leader_connect.go connect: various changes to make namespaces for intentions work more like for other subsystems (#8194) 2020-06-26 16:59:15 -05:00
leader_connect_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
leader_connect_oss_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
leader_connect_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
leader_federation_state_ae.go Ensure that retryLoopBackoff can be cancelled 2020-06-24 12:41:08 -04:00
leader_federation_state_ae_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
leader_routine_manager.go
leader_routine_manager_test.go
leader_test.go Remove ACLEnforceVersion8 from tests (#8138) 2020-06-17 14:58:01 -05:00
logging.go
logging_test.go
merge.go
merge_test.go
operator_autopilot_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
operator_autopilot_endpoint_test.go
operator_endpoint.go
operator_raft_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
operator_raft_endpoint_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
options.go Implement Client Agent Auto Config 2020-06-17 16:49:46 -04:00
prepared_query_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
prepared_query_endpoint_test.go DNS: add IsErrQueryNotFound function for easier error evaluation 2020-07-01 03:41:44 +01:00
raft_rpc.go
replication.go server: don't activate federation state replication or anti-entropy until all servers are running 1.8.0+ (#8014) 2020-06-04 16:05:27 -05:00
replication_test.go
rpc.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
rpc_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
rtt.go
rtt_test.go Enable gofmt simplify 2020-06-16 13:21:11 -04:00
segment_oss.go
serf_test.go
server.go server: Abandom state store to shutdown EventPublisher 2020-07-14 15:57:47 -04:00
server_connect.go Store the Connect CA rate limiter on the server 2020-06-30 09:59:07 -04:00
server_lookup.go
server_lookup_test.go ci: enable SA4006 staticcheck check 2020-06-16 13:10:11 -04:00
server_oss.go Move GatewayServices out of Internal 2020-06-12 13:46:47 -06:00
server_serf.go server: don't activate federation state replication or anti-entropy until all servers are running 1.8.0+ (#8014) 2020-06-04 16:05:27 -05:00
server_test.go Refactor AutoConfig RPC to not have a direct dependency on the Server type 2020-07-08 11:05:44 -04:00
session_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
session_endpoint_test.go
session_timers.go
session_timers_test.go
session_ttl.go
session_ttl_test.go
snapshot_endpoint.go
snapshot_endpoint_test.go
stats_fetcher.go
stats_fetcher_test.go
status_endpoint.go
status_endpoint_test.go
txn_endpoint.go Rename (*Server).forward to (*Server).ForwardRPC 2020-07-08 11:05:44 -04:00
txn_endpoint_test.go
util.go Remove bytesToUint64 from agent/consul 2020-06-18 12:45:43 -04:00
util_test.go Remove bytesToUint64 from agent/consul 2020-06-18 12:45:43 -04:00