Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kezhengjie/msg_queue
msg_queue written in cpp
https://github.com/kezhengjie/msg_queue
Last synced: 6 days ago
JSON representation
msg_queue written in cpp
- Host: GitHub
- URL: https://github.com/kezhengjie/msg_queue
- Owner: kezhengjie
- License: mit
- Created: 2021-08-04T06:32:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-14T04:35:28.000Z (over 3 years ago)
- Last Synced: 2024-12-25T03:22:22.567Z (10 days ago)
- Language: C++
- Size: 117 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MsgQueue
a c++ msg queue lib
```c++
// construct a msg_queue object.
MsgQueue *mq = new MsgQueue();
// could also construct by containerSize or consumerNum
// MsgQueue *mq = MsgQueueImpl(int containerSize);
// MsgQueue *mq = MsgQueueImpl(int containerSize, int consumerNum);// register a msg
// @param msgEnum int
// @param msgcallback void (*msgcb)(void *)
int msgEnum = 0;
mq->RegisterMsg(msgEnum,[](void* msg)->void{
std::cout << *((int*) msg) <PutMsg(msgEnum,pInt);
// task will work automatically.// demo/main.cpp for more usage.
```