Giter Site home page Giter Site logo

xxmingming / onemessage-c- Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jiu-xiao/onemessage

0.0 0.0 0.0 268 KB

一个基于发布-订阅模型的多线程消息框架,用于嵌入式平台,纯C实现,性能和灵活性极高

License: GNU General Public License v2.0

Python 4.56% C 89.30% CMake 6.14%

onemessage-c-'s Introduction

OneMessage

一个基于 发布-订阅模型的多线程消息框架,用于嵌入式平台,纯C语言编写,性能和灵活性极高


系统支持

已在Linux,FreeRTOS上成功运行,欢迎适配到其他平台。

特性

  • 发布-订阅

    • 底层由红黑树+链表实现,查找与遍历都有良好的性能表现
    • 话题为操作的主体,匿名发布且不限制订阅者数量
  • 安全性

    • 保证线程安全
    • 允许在中断中使用
    • 提供静态API,可以实现无动态内存分配
  • 消息过滤器

    • 支持为每个话题和订阅者注册过滤器,只接受符合条件的消息
  • 订阅回调

    • 订阅者可在接收时调用用户回调函数,暂存数据或者转发到另一个话题。
  • 快速配置

    • 使用格式化输入的方式配置话题,极少的代码量就能实现整个消息网络的搭建
  • 事件触发

    • 以订阅为核心的事件触发器,在保证执行效率的同时,一个触发条件可以对应多个处理函数。
  • 批量筛选

    • 对于条件简单且分支较多的话题,可开启高级过滤器而不需要注册大量函数,现已支持 列表范围分解模式。
  • 日志框架

    • 使用示例程序打印的日志:效果

获取源码

克隆这个仓库

Gitee

Github

git clone https://gitee.com/jiu-xiao/one-message.git

或者使用 git submodule将其包含在你的仓库中

git submodule add https://gitee.com/jiu-xiao/one-message.git <path>

代码结构

OneMessage
├─config
├─src
│  ├─app
│  ├─comp
│  └─core
└─test

文件夹 功能
config 配置文件模板
doc 文档
src/app 应用
src/comp 组件
src/core 核心api
src 用户接口
test 单元测试
example 例程
utils 工具

文档

配置文件

使用说明

开发文档

这个项目的意义

在复杂的工程中,为了实现线程的通信和数据的同步会耗费掉大量的开发时间,但往往bug都会出现在这些地方,所以需要找到一个稳定可靠的方案。OneMessage即是解决这个问题的一次尝试。

onemessage-c-'s People

Contributors

jiu-xiao 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.