class_docstr: A wrapper type for ray.ObjectRef. Currently supports ray.get but not
  ray.wait.
docstr: Create a channel that can be read and written by co-located Ray processes.
  
  Only the caller may write to the channel. The channel has no buffer,
  so the writer will block until reader(s) have read the previous value.
  
  Args:
      buffer_size_bytes: The number of bytes to allocate for the object data and
          metadata. Writes to the channel must produce serialized data and
          metadata less than or equal to this value.
  Returns:
      Channel: A wrapper around ray.ObjectRef.
docstr_tok: ["Create","a","channel","that","can","be","read","and","written","by","co-located","Ray","processes",".","Only","the","caller","may","write","to","the","channel",".","The","channel","has","no","buffer",",","so","the","writer","will","block","until","reader","(","s",")","have","read","the","previous","value",".","Args",":","buffer_size_bytes",":","The","number","of","bytes","to","allocate","for","the","object","data","and","metadata",".","Writes","to","the","channel","must","produce","serialized","data","and","metadata","less","than","or","equal","to","this","value",".","Returns",":","Channel",":","A","wrapper","around","ray.ObjectRef","."]
code: def __init__(
      self,
      buffer_size_bytes: Optional[int] = None,
      num_readers: int = 1,
      _base_ref: Optional["ray.ObjectRef"] = None,
  ):
      """
      Create a channel that can be read and written by co-located Ray processes.
  
      Only the caller may write to the channel. The channel has no buffer,
      so the writer will block until reader(s) have read the previous value.
  
      Args:
          buffer_size_bytes: The number of bytes to allocate for the object data and
              metadata. Writes to the channel must produce serialized data and
              metadata less than or equal to this value.
      Returns:
          Channel: A wrapper around ray.ObjectRef.
      """
      if buffer_size_bytes is None:
          if _base_ref is None:
              raise ValueError(
                  "One of `buffer_size_bytes` or `_base_ref` must be provided"
              )
          self._base_ref = _base_ref
      else:
          if not isinstance(buffer_size_bytes, int):
              raise ValueError("buffer_size_bytes must be an integer")
          self._base_ref = _create_channel_ref(buffer_size_bytes)
  
      if not isinstance(num_readers, int):
          raise ValueError("num_readers must be an integer")
  
      self._num_readers = num_readers
      self._worker = ray._private.worker.global_worker
      self._worker.check_connected()
  
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 1 to create a new Channel object  with example: obj = Channel(buffer_size_bytes, num_readers, _base_ref)