public class MediumEventLoop extends net.openhft.chronicle.core.io.AbstractCloseable implements CoreEventLoop, Runnable, net.openhft.chronicle.core.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
static Set<net.openhft.chronicle.core.threads.HandlerPriority> |
ALLOWED_PRIORITIES |
protected boolean |
daemon |
protected static long |
FINISHED |
protected net.openhft.chronicle.core.threads.EventHandler |
highHandler |
protected long |
loopStartMS |
protected List<net.openhft.chronicle.core.threads.EventHandler> |
mediumHandlers |
protected @NotNull net.openhft.chronicle.core.threads.EventHandler[] |
mediumHandlersArray |
protected String |
name |
protected AtomicReference<net.openhft.chronicle.core.threads.EventHandler> |
newHandler |
static int |
NO_CPU |
protected static net.openhft.chronicle.core.threads.EventHandler[] |
NO_EVENT_HANDLERS |
protected @Nullable net.openhft.chronicle.core.threads.EventLoop |
parent |
protected Pauser |
pauser |
protected @NotNull ExecutorService |
service |
protected @Nullable Thread |
thread |
| Constructor and Description |
|---|
MediumEventLoop(@Nullable net.openhft.chronicle.core.threads.EventLoop parent,
String name,
Pauser pauser,
boolean daemon,
String binding) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(@NotNull net.openhft.chronicle.core.threads.EventHandler handler) |
protected void |
addNewHandler(@NotNull net.openhft.chronicle.core.threads.EventHandler handler) |
void |
awaitTermination() |
static void |
closeAll(@NotNull List<net.openhft.chronicle.core.threads.EventHandler> handlers) |
protected void |
closeAllHandlers() |
void |
dumpRunningHandlers() |
void |
dumpRunningState(@NotNull String message,
@NotNull BooleanSupplier finalCheck) |
int |
handlerCount() |
boolean |
isAlive() |
protected void |
loopFinishedAllHandlers() |
protected void |
loopStartedAllHandlers() |
long |
loopStartMS() |
String |
name() |
int |
nonDaemonHandlerCount() |
protected void |
performClose() |
protected static void |
removeHandler(net.openhft.chronicle.core.threads.EventHandler handler,
@NotNull List<net.openhft.chronicle.core.threads.EventHandler> handlers) |
void |
run() |
protected boolean |
runAllHandlers() |
protected void |
runDaemonHandlers() |
protected void |
runTimerHandlers() |
void |
start() |
void |
stop() |
@Nullable Thread |
thread() |
protected boolean |
threadSafetyCheck(boolean isUsed) |
protected long |
timerIntervalMS() |
@NotNull String |
toString() |
void |
unpause() |
assertCloseablesClosed, clearUsedByThread, close, createdHere, disableCloseableTracing, enableCloseableTracing, isClosed, isClosing, isInUserThread, performCloseInBackground, referenceId, resetUsedByThread, shouldPerformCloseInBackground, shouldWaitForClosed, throwExceptionIfClosed, throwExceptionIfClosedInSetter, unmonitor, waitForClosed, warnAndCloseIfNotClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, closeQuietly, closeQuietly, notifyClosingpublic static final Set<net.openhft.chronicle.core.threads.HandlerPriority> ALLOWED_PRIORITIES
public static final int NO_CPU
protected static final net.openhft.chronicle.core.threads.EventHandler[] NO_EVENT_HANDLERS
protected static final long FINISHED
@Nullable protected final @Nullable net.openhft.chronicle.core.threads.EventLoop parent
@NotNull protected final @NotNull ExecutorService service
protected final List<net.openhft.chronicle.core.threads.EventHandler> mediumHandlers
protected final AtomicReference<net.openhft.chronicle.core.threads.EventHandler> newHandler
protected final Pauser pauser
protected final boolean daemon
protected final String name
@NotNull protected @NotNull net.openhft.chronicle.core.threads.EventHandler[] mediumHandlersArray
protected net.openhft.chronicle.core.threads.EventHandler highHandler
protected volatile long loopStartMS
@Nullable protected volatile @Nullable Thread thread
public MediumEventLoop(@Nullable
@Nullable net.openhft.chronicle.core.threads.EventLoop parent,
String name,
Pauser pauser,
boolean daemon,
String binding)
parent - the parent event loopname - the name of this event handlerpauser - the pause strategydaemon - is a demon threadbinding - set affinity description, "any", "none", "1", "last-1"public static void closeAll(@NotNull
@NotNull List<net.openhft.chronicle.core.threads.EventHandler> handlers)
protected static void removeHandler(net.openhft.chronicle.core.threads.EventHandler handler,
@NotNull
@NotNull List<net.openhft.chronicle.core.threads.EventHandler> handlers)
@Nullable public @Nullable Thread thread()
thread in interface CoreEventLooppublic void awaitTermination()
awaitTermination in interface net.openhft.chronicle.core.threads.EventLoop@NotNull public @NotNull String toString()
toString in class net.openhft.chronicle.core.io.AbstractCloseablepublic void start()
start in interface net.openhft.chronicle.core.threads.EventLooppublic void unpause()
unpause in interface net.openhft.chronicle.core.threads.EventLooppublic void stop()
stop in interface net.openhft.chronicle.core.threads.EventLooppublic void addHandler(@NotNull
@NotNull net.openhft.chronicle.core.threads.EventHandler handler)
addHandler in interface net.openhft.chronicle.core.threads.EventLooppublic long loopStartMS()
loopStartMS in interface CoreEventLoopprotected void loopStartedAllHandlers()
protected void loopFinishedAllHandlers()
protected long timerIntervalMS()
protected void runTimerHandlers()
protected void runDaemonHandlers()
protected boolean runAllHandlers()
protected void addNewHandler(@NotNull
@NotNull net.openhft.chronicle.core.threads.EventHandler handler)
public String name()
name in interface net.openhft.chronicle.core.threads.EventLooppublic void dumpRunningState(@NotNull
@NotNull String message,
@NotNull
@NotNull BooleanSupplier finalCheck)
dumpRunningState in interface CoreEventLooppublic int nonDaemonHandlerCount()
public int handlerCount()
protected void closeAllHandlers()
public void dumpRunningHandlers()
public boolean isAlive()
isAlive in interface net.openhft.chronicle.core.threads.EventLoopprotected void performClose()
performClose in class net.openhft.chronicle.core.io.AbstractCloseableprotected boolean threadSafetyCheck(boolean isUsed)
threadSafetyCheck in class net.openhft.chronicle.core.io.AbstractCloseableCopyright © 2021. All rights reserved.