Passing actor handles to remote tasks via class attributes

Based on the documentation, it is evident that for a remote task to act upon an actor, we can pass it the handle as a function attribute. However, suppose we have a class that maintains the actor handle as an attribute. Is it possible to use this handle directly in the remote task (method) without passing it in as a parameter? Note that the class is not an actor, but simply the driver program instantiating tasks. The following is the pseudo-code demonstrating this setup.

class Driver:
    def __init__(self, actor_handle):
        self.actor_handle = actor_handle

    @ray.remote
    def task(self):
        do_something(self.actor_handle)

I am not sure if it is possible, but I assume not? Why don’t you just create a remote task that is invoked inside a task method instead?

@ray.remote
def task(actor_handle):
    do_something()

class Driver:
    def __init__(self, actor_handle):
        self.actor_handle = actor_handle

    def task(self):
        task.remote(self.actor_handle)

That definitely works. I am not sure how it would be possible for a remote method to inspect itself during execution in order to retrieve the actual object from the object reference.