zeromq / dafka

Dafka is a decentralized distributed streaming platform
Mozilla Public License 2.0
109 stars 24 forks source link

Problem: FETCH direct messages need priority over pubsub in order to fill the gap as soon as possible #30

Closed somdoron closed 5 years ago

sappo commented 5 years ago

How are direct messages prioritized? Cannot find the code that does the prioritization.

somdoron commented 5 years ago

I added review comments, see if it helps

sappo commented 5 years ago

Where do I find the review comments? Do you mean the commit comments because they did not help, sorry.

somdoron commented 5 years ago

I create two different subscribers, one subscribe to DIRECT MESSAGE and the other one to MSG. https://github.com/somdoron/dafka/blob/9b07b72e66b6899cbc8a803e3f93d296862475cd/src/dafka_store.c#L339

To process the two subscribers, I'm using a while loop over the zsock_has_in for both subscribers https://github.com/somdoron/dafka/blob/9b07b72e66b6899cbc8a803e3f93d296862475cd/src/dafka_store.c#L408

However, the loop always a process a message from the direct subscriber, if available, and only then from the regular subscriber. https://github.com/somdoron/dafka/blob/9b07b72e66b6899cbc8a803e3f93d296862475cd/src/dafka_store.c#L415