是否有一个复杂的Java API工作队列? [英] Is there a sophisticated Java WorkQueue API?

查看:133
本文介绍了是否有一个复杂的Java API工作队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个工作队列API提供以下功能:

I am looking for a WorkQueue API offering the following features:


  • java.util.Queue中兼容

  • 报价(可选)设置语义

  • 单和批处理

  • 并发(当然)

  • 调度

  • 不同的处理策略

    • 等到下次调度执行

    • pre-过程中,若批量大小满足

    • 延迟处理(在队列最短的时间,处理前)

    有在JDK,例如许多有趣的实现 java.util.DelayQueue ,我可以使用。我只是想确保我不是另起炉灶。

    There are a lot of interesting implementations in the jdk, e.g. java.util.DelayQueue which i could use. I just wanted to make sure i am not reinventing the wheel.

    推荐答案

    您还在为寻找一个答案接受?

    Are you still looking for an answer to accept?

    我觉得你需要将最好的使用的java.util.concurrent 的执行人框架来满足。请参阅API(这里是一个良好的开端)。有一个很好的支持社区,您可以在并发兴趣的网站。如果你到死树,的Java并发实践(JCiP)提供了一个很好的资源。

    I think your needs would best be met using java.util.concurrent's executor framework. See the API (here's a good start). There's an excellent support community, you can find it at the concurrency-interest web site. If you're into dead trees, Java Concurrency in Practice (JCiP) provides an excellent resource.

    执行程序框架允许您创建任务(在的Runnable或可调用的形式),提供了几个方案,用于相对于同步或以其他方式订货任务到另一个。

    The executor framework allows you to create tasks (in the form of Runnables or Callables), provides several schemes for synchronizing or otherwise ordering tasks with respect to one another.

    最后,新兴ForkJoin(FJ)的基础设施是非常有好处的,并符合您的需求。 API是这里,一个的好纸张这里,和的介绍性的文章这里

    Finally, the emerging ForkJoin (FJ) infrastructure is quite usable and may match your needs. API is here, a good paper is here, and an introductory article here.

    希望这有助于。

    JA

    这篇关于是否有一个复杂的Java API工作队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆