SingleThreadIoEventLoop.java — netty Source File
Architecture documentation for SingleThreadIoEventLoop.java, a java file in the netty codebase.
Entity Profile
Relationship Graph
Source Code
/*
* Copyright 2024 The Netty Project
*
* The Netty Project licenses this file to you 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:
*
* https://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 io.netty.channel;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.Promise;
import io.netty.util.concurrent.RejectedExecutionHandler;
import io.netty.util.concurrent.SingleThreadEventExecutor;
import io.netty.util.internal.ObjectUtil;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.SystemPropertyUtil;
import java.util.Queue;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
* {@link IoEventLoop} implementation that execute all its submitted tasks in a single thread using the provided
* {@link IoHandler}.
*/
public class SingleThreadIoEventLoop extends SingleThreadEventLoop implements IoEventLoop {
// TODO: Is this a sensible default ?
private static final long DEFAULT_MAX_TASK_PROCESSING_QUANTUM_NS = TimeUnit.MILLISECONDS.toNanos(Math.max(100,
SystemPropertyUtil.getInt("io.netty.eventLoop.maxTaskProcessingQuantumMs", 1000)));
private final long maxTaskProcessingQuantumNs;
private final IoHandlerContext context = new IoHandlerContext() {
@Override
public boolean canBlock() {
assert inEventLoop();
return !hasTasks() && !hasScheduledTasks();
}
@Override
public long delayNanos(long currentTimeNanos) {
assert inEventLoop();
return SingleThreadIoEventLoop.this.delayNanos(currentTimeNanos);
}
@Override
public long deadlineNanos() {
assert inEventLoop();
return SingleThreadIoEventLoop.this.deadlineNanos();
}
// ... (266 more lines)
Domain
Subdomains
Source
Frequently Asked Questions
What does SingleThreadIoEventLoop.java do?
SingleThreadIoEventLoop.java is a source file in the netty codebase, written in java. It belongs to the Buffer domain, Search subdomain.
Where is SingleThreadIoEventLoop.java in the architecture?
SingleThreadIoEventLoop.java is located at transport/src/main/java/io/netty/channel/SingleThreadIoEventLoop.java (domain: Buffer, subdomain: Search, directory: transport/src/main/java/io/netty/channel).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free