本文整理汇总了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");
}