Giter Site home page Giter Site logo

microworker's Introduction

JVM 微型多线程生产消费模型

基于 jvm 平台的微型生产消费模型,项目由三个部分组成:

  • producer 生产任务
  • exporter 投递任务
  • queue 存储任务
  • consumer 消费任务

预计目标是能够完成普遍性的批量任务,且量级并不需要外部 MQ 之类的模型来解决。

简化多线程操作,直至简化为只需要编写功能函数即可(如 function produce function consumer)。

实现小而精的多线程批量任务工具。

Quick Start

test 下路径 com.nickchen.microworker.d01 有最简单的 demo 演示该框架使用。

演示内容:

  • 只需要关注功能代码,多线程加强由框架提供
  • 可以注册事件回调
  • 任务上下文

实现功能

  1. 支持单次和多次任务,方便定时任务执行
  2. 有可拓展的结束点,结束本次任务
    • 结束任务的充分且必要条件:queue 被清空,producer 已经结束
  3. 事件系统
    • 生产消费过程中触发不同的事件
    • 自注册事件回调

TODO

  • Producer 需要限速,根据当前队列大小需要阻塞

microworker's People

Contributors

nickchenyx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.