mirror of
https://github.com/gravitational/teleport
synced 2024-10-23 02:32:39 +00:00
4e9eed9ac0
- cache now perforams in-memory fanout of events, eliminating spurious event generation due to cache init/reset. - removed old unused logic from reversetunnel agents. - replaced seekpool with simpler ttl-cache and semaphore-like lease system. - add jittered backoff to agent connection attempts to reduce "thundering herd" effect. - improved reversetunnel logging. - improved LB usage in tests.
38 lines
1.5 KiB
Go
38 lines
1.5 KiB
Go
/*
|
|
Copyright 2020 Gravitational, Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// Package workpool provies the `Pool` type which functions as a means
|
|
// of managing the number of concurrent workers,
|
|
// grouped by key. You can think of this type as functioning
|
|
// like a collection of semaphores, except that multiple distinct resources may
|
|
// exist (distinguished by keys), and the target concurrent worker count may
|
|
// change at runtime. The basic usage pattern is as follows:
|
|
//
|
|
// 1. The desired number of workers for a given key is specified
|
|
// or updated via Pool.Set.
|
|
//
|
|
// 2. Workers are spawned as leases become available on Pool.Acquire.
|
|
//
|
|
// 3. Workers relenquish their leases when they finish their work
|
|
// by calling Lease.Release.
|
|
//
|
|
// 4. New leases become available as old leases are relenquished, or
|
|
// as the target concurrent lease count increases.
|
|
//
|
|
// This is a generalization of logic originally written to manage the number
|
|
// of concurrent reversetunnel agents per proxy endpoint.
|
|
package workpool
|