ray.put#

ray.put(value: Any, *, _owner: ActorHandle | None = None) ray._raylet.ObjectRef[source]#

Store an object in the object store.

The object may not be evicted while a reference to the returned ID exists.

Related patterns and anti-patterns:

Parameters:
  • value – The Python object to be stored.

  • [Experimental] (_owner) – The actor that should own this object. This allows creating objects with lifetimes decoupled from that of the creating process. The owner actor must be passed a reference to the object prior to the object creator exiting, otherwise the reference will still be lost. Note that this argument is an experimental API and should be avoided if possible.

Returns:

The object ref assigned to this value.