Currently, the NotifierHub is not thread-safe by design, which isn't an issue since users can wrap it in an Arc<Mutex<>> or other synchronization primitives if needed. However, it would be beneficial to offer an out-of-the-box thread-safe wrapper for the NotifierHub that retains all existing methods.
Additionally, this wrapper could introduce useful functionalities, such as batch operations. For example, a send_multiple method could take a list of channel IDs and a corresponding list of messages (with the same length) to send to each channel in a single lock acquisition, thereby improving performance in concurrent scenarios.
This enhancement would make the library more user-friendly and provide additional flexibility for multi-threaded use cases.
Currently, the NotifierHub is not thread-safe by design, which isn't an issue since users can wrap it in an Arc<Mutex<>> or other synchronization primitives if needed. However, it would be beneficial to offer an out-of-the-box thread-safe wrapper for the NotifierHub that retains all existing methods.
Additionally, this wrapper could introduce useful functionalities, such as batch operations. For example, a send_multiple method could take a list of channel IDs and a corresponding list of messages (with the same length) to send to each channel in a single lock acquisition, thereby improving performance in concurrent scenarios.
This enhancement would make the library more user-friendly and provide additional flexibility for multi-threaded use cases.