com.google.common.util.concurrent.AbstractExecutionThreadService

Here are the examples of the java api class com.google.common.util.concurrent.AbstractExecutionThreadService taken from open source projects.

1. GeneratorTransport#doLaunch()

Project: graylog2-server
File: GeneratorTransport.java
@Override
public void doLaunch(final MessageInput input) throws MisfireException {
    generatorService = new AbstractExecutionThreadService() {

        @Override
        protected void run() throws Exception {
            while (isRunning()) {
                if (isThrottled()) {
                    blockUntilUnthrottled();
                }
                final RawMessage rawMessage = GeneratorTransport.this.produceRawMessage(input);
                if (rawMessage != null) {
                    input.processRawMessage(rawMessage);
                }
            }
        }
    };
    generatorService.startAsync();
}