# Feature request about \`acor.wait()\` API

**URL:** <https://discuss.ray.io/t/feature-request-about-acor-wait-api/1382>\
**Category:** Ray Core\
**Created:** [March 24, 2021, 4:17pm UTC](https://discuss.ray.io/t/feature-request-about-acor-wait-api/1382 "2021-03-24T16:17:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jovany-wang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jovany-wang/32/364_2.png) [@jovany-wang](https://discuss.ray.io/u/jovany-wang)\
**Post date:** [March 24, 2021, 4:17pm UTC](https://discuss.ray.io/t/feature-request-about-acor-wait-api/1382/1 "2021-03-24T16:17:30Z")

</div>

## 1. Problems And Background

Many users’ code needs a function that waits for an actor to complete. Previously, we were encouraging users to implement meaningless remote calls such as `ray.wait (actor.no_op.remote())` to workaround. But as the scale of the user code repository grows, so does the cost of maintenance.

Therefore, I’d like to propose an API that waits for an actor to be created successfully, to simplify such operations for users.

## 2. API

python

```python
actor.wait(timeout_ms=500)
actor.wait() # timout_ms is infinite

```

Java

```java
actor.wait(500, TimeUnit.MilliSeconds);
actor.wait(); // timeoutMs is infinite

```

Exceptions such as `TimeoutException`, `ActorDeadException` would be thrown if the actor is not created successfully.

PS:  
We have no need to implement `ray.wait(actor_list)` API currently. If we have the needs of `ray.wait(actor_list)` API in the future, it’s easy to wrap by:

```auto
def wait(actor_list):
    for actor in actor_list:
        actor.wait()

```

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [March 24, 2021, 5:57pm UTC](https://discuss.ray.io/t/feature-request-about-acor-wait-api/1382/2 "2021-03-24T17:57:22Z")

</div>

Can you create a Github issue with RFC label? We need to core API change approval for this type of API updates.
