Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change maxInFlight dynamically #273

Open
apmcodes opened this issue Jan 24, 2019 · 1 comment
Open

change maxInFlight dynamically #273

apmcodes opened this issue Jan 24, 2019 · 1 comment

Comments

@apmcodes
Copy link

Please suggest a way to dynamically change a reader's maxInFlight.

[Ref #256 ]

@apmcodes
Copy link
Author

Tried the following and it seems to work.

@dudleycarr Can you please confirm if this is a correct way of dynamically changing maxInFlight and there won't be any bug/ pitfall at scale?. Is there a need to call balance() as well? Thank you.

consumer.js

            console.log('Old maxInFlight', self.reader.readerRdy.maxInFlight);
            self.reader.readerRdy.maxInFlight = 10;
            self.reader.readerRdy.connections.forEach((connRdy) => {
                connRdy.setConnectionRdyMax(10);
            })
            // self.reader.readerRdy.balance();
            console.log('New maxInFlight', self.reader.readerRdy.maxInFlight);

The above fetches 10 jobs at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant