Die4Ever / Die4Ever/AsyncGameEngine
Better framework
- Dominant language
- C++
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Maybe something like
main.cpp:
void HandleMessage(MessageBlock &out, Message in);
int main()
{
while(1) { messagequeue.proc(); }
}
MessageQueue.h:
void proc()
{
MessageBlock mb;
for(auto m : EachMessage(cursor) ) {
if(mb.len>10000) send(mb);
HandleMessage (mb, m);
}
if(mb.len) send(mb);
}
Not too different from what I have now, but this could let me delete the complicated iterator stuff
Should I limit MAX_MESSAGE_SIZE to be half of MAX_MESSAGEBLOCK_SIZE so I know when to flush? Or maybe keep a vector of blocks, and just pass a new block to the function when one gets full?
Maybe this would be the corelib, and then there would be a more abstract library where you give it callback functions for different message types. Maybe the type member of a message could have 1 byte for generic type and the other byte for the application specific type?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.