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

Send custom messages to workers #496

Open
nicholasdavidson opened this issue Jun 4, 2022 · 3 comments
Open

Send custom messages to workers #496

nicholasdavidson opened this issue Jun 4, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@nicholasdavidson
Copy link

Apologies if this is in the examples somewhere, but I was looking at converting a distributed locust test to goose and couldn't see any obvious way of sending custom messages from the manager to the worker.

I've typically used this to distribute some finite resource like a pre-created pool of credentials to workers.

I could do something like sending the pool to all workers and bucket the pool by worker number, but wondered if I'd just missed how to send custom messages.

@jeremyandrews jeremyandrews added the enhancement New feature or request label Jun 7, 2022
@jeremyandrews
Copy link
Member

Unfortunately this is not currently supported by Goose.

Can you send a link to how custom messaging works in Locust?

@nicholasdavidson
Copy link
Author

The https://docs.locust.io/en/stable/api.html#locust.runners.MasterRunner provides the register message and send_message hooks which allow you to send and acknowledge any message between the master and its swarm workers.
This is usefully combined with the event listeners decorators to send messages once the worker has initialised.
An example can be read here: https://github.com/locustio/locust/blob/master/examples/custom_messages.py

If this is something that you would be interested in accepting I could try and come up with a PR?

You're already using serd so it'd be a bit of work around the send_message loop in manager.rs, and I guess we'd need a trait for user messages as well as requiring them to be send/sync and Serialize / Deserialize.

@jeremyandrews
Copy link
Member

PR's are always welcome! I definitely think this would be a useful feature to add.

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

No branches or pull requests

2 participants