Giter Site home page Giter Site logo

Comments (4)

hylkevds avatar hylkevds commented on May 24, 2024

This bit of code happens when the thread that wants to add a command to a queue is the thread that handles the queue the command is added to. This only happens for Acknowledge messages, which should have priority and skip the queue.

from moquette.

SpringStudent avatar SpringStudent commented on May 24, 2024

This bit of code happens when the thread that wants to add a command to a queue is the thread that handles the queue the command is added to. This only happens for Acknowledge messages, which should have priority and skip the queue.

I cannot find in the source code where the EventLoop thread is used to handle the addition of commands. Therefore, I believe the above code will never be execute,So is there still a need for that code segment?

from moquette.

hylkevds avatar hylkevds commented on May 24, 2024

Indeed, this currently also happens for Publish commands if the publisher is on the same thread as the receiver. And this indeed causes these publishes to jump the queue.

There are cases where the command must jump the queue. For instance the SessionRegistry::remove() has the goal of cleaning up the queues. If this happens because the client re-connected with cleanSession=true, this will be called from the same thread, and it should probably happen directly (not entirely sure there).

We may have to add a flag to indicate the action should jump the Queue or not.

from moquette.

SpringStudent avatar SpringStudent commented on May 24, 2024

be

Indeed, this currently also happens for Publish commands if the publisher is on the same thread as the receiver. And this indeed causes these publishes to jump the queue.

There are cases where the command must jump the queue. For instance the SessionRegistry::remove() has the goal of cleaning up the queues. If this happens because the client re-connected with cleanSession=true, this will be called from the same thread, and it should probably happen directly (not entirely sure there).

We may have to add a flag to indicate the action should jump the Queue or not.

I debugged the source code and realized that you were right. I will close the issue. Thank you for your patient response.

from moquette.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.