Skip to content

Commit

Permalink
Update Javadoc of NonBlocking
Browse files Browse the repository at this point in the history
  • Loading branch information
minwoox committed Dec 16, 2024
1 parent 2a559fb commit 0f40a78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion core/src/main/java/com/linecorp/armeria/common/NonBlocking.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
package com.linecorp.armeria.common;

/**
* A dummy interface that indicates non-blocking thread.
* An interface that indicates a non-blocking thread. You can use this interface to check if the current
* thread is a non-blocking thread. For example:
* <pre>{@code
* if (Thread.currentThread() instanceof NonBlocking) {
* // Avoid blocking operations.
* closeable.closeAsync();
* } else {
* closeable.close();
* }
* }</pre>
*/
public interface NonBlocking {}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* An event loop thread with support for {@link TemporaryThreadLocals}, Netty {@link FastThreadLocal} and
* Project Reactor {@link NonBlocking}.
* {@link NonBlocking} interface.
*/
public final class EventLoopThread extends FastThreadLocalThread implements NonBlocking {

Expand Down

0 comments on commit 0f40a78

Please sign in to comment.