mpokorny / vysmaw

Fast visibility stream muncher
GNU General Public License v3.0
1 stars 2 forks source link

Add dynamic consumer management capability #10

Closed mpokorny closed 6 years ago

mpokorny commented 7 years ago

Currently, users need to provide a list of consumers (which effectively means a list of callback functions) when vysmaw starts, and that list is then fixed for the life of the vysmaw handle. What I'm considering is adding the ability to add and remove consumers under the user's control during the lifetime of a handle. Such a feature would allow a user to add new callback functions, each associated with one consumer (and message queue), and remove those the application code has finished using, without starting a new vysmaw handle.

mpokorny commented 7 years ago

As for API, something like the following additions

void vysmaw_add_consumer(vysmaw_handle handle, struct vysmaw_consumer *consumer);
void vysmaw_remove_consumer(vysmaw_handle handle, struct vysmaw_consumer *consumer);

It would still be the application's responsibility in all cases to remove messages from every consumer's queue until a VYSMAW_END_MESSAGE appears.

The above functions can be called on any "alive" vysmaw handle.

Implementation notes:

mpokorny commented 6 years ago

The ability to support multiple consumers for a single vysmaw handle is being removed, so this issue is now effectively moot.