public interface IdleStrategy
-XX:CompileCommand=dontinline,org.agrona.concurrent.NoOpIdleStrategy::idle
Modifier and Type | Method and Description |
---|---|
void |
idle()
Perform current idle action (e.g.
|
void |
idle(int workCount)
Perform current idle action (e.g.
|
void |
reset()
Reset the internal state in preparation for entering an idle state again.
|
void idle(int workCount)
Callers are expected to follow this pattern:
while (isRunning)
{
idleStrategy.idle(doWork());
}
workCount
- performed in last duty cycle.void idle()
reset()
to clear internal state when idle period is over (or before it begins).
Callers are expected to follow this pattern:
while (isRunning)
{
if (!hasWork())
{
idleStrategy.reset();
while (!hasWork())
{
if (!isRunning)
{
return;
}
idleStrategy.idle();
}
}
doWork();
}
void reset()
Copyright © 2014-2019 Real Logic Ltd. All Rights Reserved.