[rllib]Help!How can cartpole_client.py and cartpole_server.py use tune to set up distributed enviroment?

I use this code
to set up my own gym environment, and then run this code on the server

code

Could any one please tell me how to add tune in these code to run distributed enviroment?

I see here it seen like can run any number of clients, but how to use tune to select parameters or this mode can’t run with tune ?

image
Try it yourself by launching either a simple CartPole server (see below), and connecting it to any number of clients (cartpole_client.py)

I search for ray-project/ray/blob/master/rllib/examples/custom_train_fn.py and ray-project/ray/tree/master/rllib/tuned_examples

But have no idea how to use tune in client and server mode?

Could any one help me?

I find a example code and can anyone please told me can this work?

take the main code in cartpole_server.py to replace my_train_fn function and then run tune.run?