當前位置: 首頁>>代碼示例>>Java>>正文


Java OS.TMP屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:Vanilla-Java,項目名稱:Microservices,代碼行數:16,代碼來源:ComponentsBenchmark.java

示例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());
    }
}
 
開發者ID:Vanilla-Java,項目名稱:Microservices,代碼行數:9,代碼來源:HelloWorldDumpMain.java

示例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");
}
 
開發者ID:Vanilla-Java,項目名稱:Microservices,代碼行數:37,代碼來源:HelloWorldClientMain.java

示例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");
}
 
開發者ID:Vanilla-Java,項目名稱:Microservices,代碼行數:7,代碼來源:HelloWorldMain.java

示例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");
}
 
開發者ID:Vanilla-Java,項目名稱:Microservices,代碼行數:7,代碼來源:OrderManagerMain.java


注:本文中的net.openhft.chronicle.core.OS.TMP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。