当前位置: 首页>>代码示例>>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;未经允许,请勿转载。