v 1.0.0 is now released.
This version replaces the dynamic std::queue with a statically allocated circular buffer and removes the Software Timer in favor of a .process()
method.
Replacing the std::queue with the circular buffer is a trade off in ease of use and memory size vs stability. The circular buffer allocates all the memory it could ever use when the program begins, but then never resizes (or relocates) which avoids potential heap fragmentation. In order to keep PublishManager slightly flexible, the library is now instantiated using a template to define the buffer.
The default instantiation: PublishManager<> publishManager()
will allocate a buffer than can hold 5 events with the maximum publish-able eventName (63 characters) and data (255 bytes) which takes up about ~1590 bytes of heap. You can optimize the buffer however you like to use less memory and/or hold more events
Removing the Software Timer does 2 things:
- Makes the actual publish safer (the Software Timer callback has a limited stack size) and
- Makes the library equally compatible with Core