Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.

```