class_docstr: A wrapper type for ray.ObjectRef. Currently supports ray.get but not
  ray.wait.
docstr: Write a value to the channel.
  
  Blocks if there are still pending readers for the previous value. The
  writer may not write again until the specified number of readers have
  called ``end_read_channel``.
  
  Args:
      value: The value to write.
      num_readers: The number of readers that must read and release the value
          before we can write again.
docstr_tok: ["Write","a","value","to","the","channel",".","Blocks","if","there","are","still","pending","readers","for","the","previous","value",".","The","writer","may","not","write","again","until","the","specified","number","of","readers","have","called","``","end_read_channel","``",".","Args",":","value",":","The","value","to","write",".","num_readers",":","The","number","of","readers","that","must","read","and","release","the","value","before","we","can","write","again","."]
code: def write(self, value: Any, num_readers: Optional[int] = None):
      """
      Write a value to the channel.
  
      Blocks if there are still pending readers for the previous value. The
      writer may not write again until the specified number of readers have
      called ``end_read_channel``.
  
      Args:
          value: The value to write.
          num_readers: The number of readers that must read and release the value
              before we can write again.
      """
      if num_readers is None:
          num_readers = self._num_readers
      if num_readers <= 0:
          raise ValueError(
              "``num_readers`` must be a positive integer."
          )
  
      try:
          serialized_value = (
              self._worker.get_serialization_context().serialize(value)
          )
      except TypeError as e:
          sio = io.StringIO()
          ray.util.inspect_serializability(value, print_file=sio)
          msg = (
              "Could not serialize the put value "
              f"{repr(value)}:\n"
              f"{sio.getvalue()}"
          )
          raise TypeError(msg) from e
  
      self._worker.core_worker.experimental_mutable_object_put_serialized(
          serialized_value,
          self._base_ref,
          num_readers,
      )
  
file_path: ray/python/ray/experimental/channel.py
imports: import io
  import logging
  from typing import Any, Optional
  import ray
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 4 for calling the Channel obj's underlying member method code with example usage: obj.write(value, num_readers) without return types