yr.object_ref.ObjectRef

Contents

yr.object_ref.ObjectRef#

class yr.object_ref.ObjectRef(object_id: str, task_id=None, need_incre=True, need_decre=True, exception=None, enable_tensor_transport=False)[source]#

Bases: object

Initialize the ObjectRef.

Attributes

id

ObjectRef id.

task_id

Task id.

Methods

__init__

Initialize the ObjectRef.

as_future

Wrap ObjectRef with an asyncio.Future.

cancel

Cancel the obj future

done

Return True if the obj future was cancelled or finished executing.

exception

Raise exception if exception is not none.

get

This function is used to retrieve an object.

get_future

Get future.

is_exception

Whether future exception.

on_complete

Register callback.

set_data

Set data.

set_exception

Set exception.

wait

Wait stateless function done.