本文整理匯總了Java中net.openhft.chronicle.core.OS.TMP屬性的典型用法代碼示例。如果您正苦於以下問題:Java OS.TMP屬性的具體用法?Java OS.TMP怎麽用?Java OS.TMP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.openhft.chronicle.core.OS
的用法示例。
在下文中一共展示了OS.TMP屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setup
@Setup
public void setup() {
String target = OS.TMP;
upQueuePath = new File(target, "ComponentsBenchmark-up-" + System.nanoTime());
upQueue = SingleChronicleQueueBuilder.binary(upQueuePath).build();
smdWriter = upQueue.acquireAppender().methodWriter(SidedMarketDataListener.class);
downQueuePath = new File(target, "ComponentsBenchmark-down-" + System.nanoTime());
downQueue = SingleChronicleQueueBuilder.binary(downQueuePath).build();
MarketDataListener mdWriter = downQueue.acquireAppender().methodWriter(MarketDataListener.class);
SidedMarketDataCombiner combiner = new SidedMarketDataCombiner(mdWriter);
reader = upQueue.createTailer().methodReader(combiner);
System.out.println("up-q " + upQueuePath);
}
示例2: main
public static void main(String... args) {
String input = args.length > 0 ? args[0] : OS.TMP + "/input";
String output = args.length > 1 ? args[1] : OS.TMP + "/output";
try (ChronicleQueue inputQ = SingleChronicleQueueBuilder.binary(input).build();
ChronicleQueue outputQ = SingleChronicleQueueBuilder.binary(output).build()) {
System.out.println(inputQ.dump());
System.out.println(outputQ.dump());
}
}
示例3: main
public static void main(String[] args) {
String input = args.length > 0 ? args[0] : OS.TMP + "/input";
String output = args.length > 1 ? args[1] : OS.TMP + "/output";
AtomicLong lastUpdate = new AtomicLong(System.currentTimeMillis() + 1000);
Thread thread = new Thread(() -> {
ChronicleQueue outputQ = SingleChronicleQueueBuilder.binary(output).build();
MethodReader reader = outputQ.createTailer().methodReader((HelloReplier) err::println);
while (!Thread.interrupted()) {
if (reader.readOne()) {
lastUpdate.set(System.currentTimeMillis());
} else {
Jvm.pause(10);
}
}
});
thread.setDaemon(true);
thread.start();
ChronicleQueue inputQ = SingleChronicleQueueBuilder.binary(input).build();
HelloWorld helloWorld = inputQ.createAppender().methodWriter(HelloWorld.class);
Scanner scanner = new Scanner(System.in);
while (true) {
while (System.currentTimeMillis() < lastUpdate.get() + 30)
Thread.yield();
out.print("Chat ");
out.flush();
if (!scanner.hasNextLine())
break;
String line = scanner.nextLine();
helloWorld.hello(line);
lastUpdate.set(System.currentTimeMillis());
}
out.print("Bye");
}
示例4: main
public static void main(String... args) {
String input = args.length > 0 ? args[0] : OS.TMP + "/input";
String output = args.length > 1 ? args[1] : OS.TMP + "/output";
serviceWrapper = ServiceWrapperBuilder.serviceBuilder(input, output,
HelloReplier.class, HelloWorldImpl::new).get();
System.out.println("Started");
}
示例5: main
public static void main(String... args) {
String input = args.length > 0 ? args[0] : OS.TMP + "/order-input";
String output = args.length > 1 ? args[1] : OS.TMP + "/order-output";
serviceWrapper = ServiceWrapperBuilder.serviceBuilder(input, output,
OrderListener.class, OrderManager::new).get();
System.out.println("Started");
}