# Automatically create actors for incoming requests

**URL:** <https://discuss.ray.io/t/automatically-create-actors-for-incoming-requests/8750>\
**Category:** RLlib\
**Created:** [December 21, 2022, 10:48pm UTC](https://discuss.ray.io/t/automatically-create-actors-for-incoming-requests/8750 "2022-12-21T22:48:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denys\_Ashikhin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/denys_ashikhin/32/58_2.png) [@Denys\_Ashikhin](https://discuss.ray.io/u/Denys_Ashikhin)\
**Post date:** [December 21, 2022, 10:48pm UTC](https://discuss.ray.io/t/automatically-create-actors-for-incoming-requests/8750/1 "2022-12-21T22:48:14Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- None: Just asking a question out of curiosity

Hi,

I am wanting to make a system that has a trainer (PPO) fully set up locally on a server, then the client would send requests for predictions from an environment. The server would then create an actor (or process?) that creates a new ID for the session and essentially `trains` on the incoming requests.

The idea here is to create a game and have clients make HTTP requests for predictions (the latency does not affect the gameplay). I am aware of Unity ML agents, but the clients may be connected/disconnected at will and from environments that don’t have python installed for example.

Is this possible? If so, can anyone point me in the right direction?

Thanks!

Edit:  
In particular, there is the policy\_client + policy\_server. Can I have a request be sent to the policy\_client whenever I need a new game (from a client) which would use the `new` method to startup a new game that is running parallel to the other games? policy\_client then forwards all the requests as normal to police\_server.

So instead of policy\_client running the game, it is getting requests with all the information from different devices, and acting as a mediary for policy\_server

---

<div class="post-metadata">

**Author:** ![arturn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/arturn/32/2096_2.png) [@arturn](https://discuss.ray.io/u/arturn)\
**Post date:** [December 25, 2022, 12:08pm UTC](https://discuss.ray.io/t/automatically-create-actors-for-incoming-requests/8750/2 "2022-12-25T12:08:35Z")

</div>

Hi @Denys_Ashikhin ,

Have a look at `ExternalEnv` and `PolicyClient`.  
I can’t point you into the right direction though, you’ll have to code this up yourself.  
You can modify PolicyClient to your liking.
