# Multiple requests to a single Actor

**URL:** <https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639>\
**Category:** Ray Core\
**Created:** [September 25, 2021, 8:27pm UTC](https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639 "2021-09-25T20:27:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ray\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ray_user/32/1164_2.png) [@ray\_user](https://discuss.ray.io/u/ray_user)\
**Post date:** [September 25, 2021, 8:27pm UTC](https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639/1 "2021-09-25T20:27:35Z")

</div>

Lets say i have an Actor class

```
@ray.remote
class Blah:

   def method():
      .. processing .....

```

Then let say I call :

` blah.method.remote()`

and then as the actor is still processing, I do a second call

` blah.method.remote()`

will the call be blocked until the processing of the first finished.

Because the Actor is a single process.

---

<div class="post-metadata">

**Author:** ![yic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yic/32/437_2.png) [@yic](https://discuss.ray.io/u/yic)\
**Post date:** [September 28, 2021, 1:45am UTC](https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639/2 "2021-09-28T01:45:14Z")

</div>

The second one will be queued until the first one is finished. But it’s async and in your script, unless you call ray.get(), it won’t block your program.

---

<div class="post-metadata">

**Author:** ![ray\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ray_user/32/1164_2.png) [@ray\_user](https://discuss.ray.io/u/ray_user)\
**Post date:** [September 28, 2021, 3:04pm UTC](https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639/3 "2021-09-28T15:04:21Z")

</div>

> [@yic](#):
>
> But it’s async and in your script, unless you call ray.get(), it won’t block your program.

did u mean :

But **if your script is using async** , unless you call ray.get(), it won’t block your program.

i.e. .remote() wont wait ?

---

<div class="post-metadata">

**Author:** ![yic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yic/32/437_2.png) [@yic](https://discuss.ray.io/u/yic)\
**Post date:** [September 28, 2021, 5:13pm UTC](https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639/4 "2021-09-28T17:13:32Z")

</div>

I believe you can give the following script a try:

```auto
import ray
import time
class Actor:
    def func(self):
        time.sleep(10)

a = Actor.remote()

obj1 = a.func.remote()
obj2 = a.func.remote()

print("CALLED", time.perf_counter())
ray.get([obj1, obj2])
print("FINISHED", time.perf_counter())

```

And it’ll output:

```auto
CALLED 3334824.667657991
FINISHED 3334845.113125455

```

> [@ray\_user](#):
>
> But **if your script is using async** , unless you call ray.get(), it won’t block your program.

No, I mean the function is async by default, until you call wait/get

---

<div class="post-metadata">

**Author:** ![ray\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ray_user/32/1164_2.png) [@ray\_user](https://discuss.ray.io/u/ray_user)\
**Post date:** [September 28, 2021, 7:39pm UTC](https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639/5 "2021-09-28T19:39:55Z")

</div>

Ooo i see … every call takes 10 secs on the **remote** end …and second one is processed after the first finishes… but you get the result after you call .get() i.e. **current** process is blocked for 20 sec

of course if you dont call .get() it has no impact on the current process …

I just wanted to be reassured that the remote Actor acts as a single process i.e. every next request is processed sequentially … one after the other

thanks

---

<div class="post-metadata">

**Author:** ![yic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yic/32/437_2.png) [@yic](https://discuss.ray.io/u/yic)\
**Post date:** [September 29, 2021, 5:42am UTC](https://discuss.ray.io/t/multiple-requests-to-a-single-actor/3639/6 "2021-09-29T05:42:43Z")

</div>

> [@ray\_user](#):
>
> I just wanted to be reassured that the remote Actor acts as a single process i.e. every next request is processed sequentially … one after the other

Yes, it’s a single process and we have code to ensure they are executed one by one
