mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 06:44:51 +02:00
Add QuotaHandler to GCP proxy
The quota handler terminates connections when quota is exceeded. The next CL will add instrumentation for quota related metrics. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185042675
This commit is contained in:
parent
d38e29fd5e
commit
6ca523386a
10 changed files with 550 additions and 35 deletions
|
@ -48,6 +48,9 @@ import io.netty.handler.ssl.SslProvider;
|
|||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
|
@ -255,6 +258,16 @@ public class ProxyModule {
|
|||
return new SystemClock();
|
||||
}
|
||||
|
||||
@Provides
|
||||
static ExecutorService provideExecutorService() {
|
||||
return Executors.newWorkStealingPool();
|
||||
}
|
||||
|
||||
@Provides
|
||||
static ScheduledExecutorService provideScheduledExecutorService() {
|
||||
return Executors.newSingleThreadScheduledExecutor();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
ProxyConfig provideProxyConfig(Environment env) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue