本文整理了Java中org.agrona.concurrent.YieldingIdleStrategy.<init>()
方法的一些代码示例,展示了YieldingIdleStrategy.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YieldingIdleStrategy.<init>()
方法的具体详情如下:
包路径:org.agrona.concurrent.YieldingIdleStrategy
类名称:YieldingIdleStrategy
方法名:<init>
暂无
代码示例来源:origin: real-logic/aeron
/**
* Create a proxy with a {@link Publication} for sending control message requests.
* <p>
* This provides a default {@link IdleStrategy} of a {@link YieldingIdleStrategy} when offers are back pressured
* with a defaults of {@link AeronArchive.Configuration#MESSAGE_TIMEOUT_DEFAULT_NS} and
* {@link #DEFAULT_RETRY_ATTEMPTS}.
*
* @param publication publication for sending control messages to an archive.
*/
public ArchiveProxy(final Publication publication)
{
this(
publication,
new YieldingIdleStrategy(),
new SystemNanoClock(),
MESSAGE_TIMEOUT_DEFAULT_NS,
DEFAULT_RETRY_ATTEMPTS);
}
代码示例来源:origin: real-logic/aeron
.termBufferSparseFile(true)
.threadingMode(threadingMode)
.sharedIdleStrategy(new YieldingIdleStrategy())
.spiesSimulateConnection(true)
.errorHandler(Throwable::printStackTrace)
代码示例来源:origin: io.aeron/aeron-all
/**
* Create a proxy with a {@link Publication} for sending control message requests.
* <p>
* This provides a default {@link IdleStrategy} of a {@link YieldingIdleStrategy} when offers are back pressured
* with a defaults of {@link AeronArchive.Configuration#MESSAGE_TIMEOUT_DEFAULT_NS} and
* {@link #DEFAULT_RETRY_ATTEMPTS}.
*
* @param publication publication for sending control messages to an archive.
*/
public ArchiveProxy(final Publication publication)
{
this(
publication,
new YieldingIdleStrategy(),
new SystemNanoClock(),
MESSAGE_TIMEOUT_DEFAULT_NS,
DEFAULT_RETRY_ATTEMPTS);
}
代码示例来源:origin: real-logic/artio
public static void main(final String[] args)
{
final LibraryConfiguration libraryConfiguration = new LibraryConfiguration()
.libraryAeronChannels(singletonList(SoleEngine.AERON_CHANNEL))
.libraryIdleStrategy(new YieldingIdleStrategy());
libraryConfiguration.replyTimeoutInMs(1000);
try (FixLibrary library = SampleUtil.blockingConnect(libraryConfiguration))
{
System.out.println("Connected");
while (library.isConnected())
{
library.poll(1);
Thread.yield();
}
}
}
}
代码示例来源:origin: real-logic/artio
@Before
public void setUp()
{
mediaDriver = TestFixtures.launchMediaDriver();
aeronArchive = AeronArchive.connect();
recordingIdLookup = new RecordingIdLookup(new YieldingIdleStrategy(), aeron().countersReader());
aeronArchive.startRecording(CHANNEL, STREAM_ID, SourceLocation.LOCAL);
final Aeron aeron = aeron();
publication = aeron.addExclusivePublication(CHANNEL, STREAM_ID);
subscription = aeron.addSubscription(CHANNEL, STREAM_ID);
final File logFile = logFile(SESSION_ID);
IoUtil.deleteIfExists(logFile);
newReplayIndex();
query = new ReplayQuery(
DEFAULT_LOG_FILE_DIR,
DEFAULT_LOGGER_CACHE_NUM_SETS,
DEFAULT_LOGGER_CACHE_SET_SIZE,
existingBufferFactory,
DEFAULT_OUTBOUND_LIBRARY_STREAM,
new NoOpIdleStrategy(),
aeronArchive,
errorHandler,
DEFAULT_ARCHIVE_REPLAY_STREAM);
returnBuffer(indexBuffer, SESSION_ID);
returnBuffer(ByteBuffer.allocate(16 * 1024), SESSION_ID_2);
when(newBufferFactory.map(any(), anyInt())).thenReturn(indexBuffer);
}
代码示例来源:origin: real-logic/artio
public static MediaDriver.Context mediaDriverContext(final int termBufferLength, final boolean dirsDeleteOnStart)
{
return new MediaDriver.Context()
.useWindowsHighResTimer(true)
.threadingMode(SHARED)
.sharedIdleStrategy(new YieldingIdleStrategy())
.dirDeleteOnStart(dirsDeleteOnStart)
.warnIfDirectoryExists(false)
.publicationTermBufferLength(termBufferLength)
.ipcTermBufferLength(termBufferLength);
}
内容来源于网络,如有侵权,请联系作者删除!