Directed Graph Processing in Java

前端 未结 4 1507
长发绾君心
长发绾君心 2020-12-17 21:49

I am looking to implement a Java application that will compute a set of tasks to execute. The tasks will have dependencies on each other, forming a directed graph. Is ther

4条回答
  •  渐次进展
    2020-12-17 22:50

    Dexecutor to the rescue, Dexecutor is designed to execute dependent independent tasks in a reliable way.

    DexecutorConfig config = new DexecutorConfig<>(executorService, new SleepyTaskProvider());
    DefaultDexecutor executor = new DefaultDexecutor(config);
    // Graph building
    executor.addDependency(1, 2);
    executor.addDependency(1, 2);
    executor.addDependency(1, 3);
    executor.addDependency(3, 4);
    executor.addDependency(3, 5);
    executor.addDependency(3, 6);
    executor.addDependency(2, 7);
    executor.addDependency(2, 9);
    executor.addDependency(2, 8);
    executor.addDependency(9, 10);
    executor.addDependency(12, 13);
    executor.addDependency(13, 4);
    executor.addDependency(13, 14);
    executor.addIndependent(11);
    //Execution
    executor.execute(ExecutionConfig.NON_TERMINATING);
    

    Refer How Do I? for more detail

    Why Dexecutor

    • Ultra light weight
    • Ultra Fast
    • Immediate/Scheduled Retry Logic supported
    • Non terminating behaviour supported
    • Conditionally skip the task execution
    • Good test coverage to keep you safe from harm
    • Available in maven central
    • Good amount of documentation
    • Distribute Execution Supported (Ignite, Hazelcast, Infinispan)

    Usefull links

    • Dexecutor Blogs
    • Dexecutor Website
    • Dexecutor Wiki
    • Dexecutor Source Code

    Disclaimer : I am the owner

提交回复
热议问题