class_docstr: Barrier to collect results and process them in bulk.
  
  A barrier can be used to collect multiple results and process them in bulk once
  a certain count or a timeout is reached.
  
  For instance, if ``max_results=N``, the ``on_completion`` callback will be
  invoked once :meth:`arrive` has been called ``N`` times.
  
  The completion callback will only be invoked once, even if more results
  arrive after completion. The collected results can be resetted
  with :meth:`reset`, after which the callback may be invoked again.
  
  The completion callback should expect one argument, which is the barrier
  object that completed.
  
  Args:
      max_results: Maximum number of results to collect before a call to
          :meth:`wait` resolves or the :meth:`on_completion` callback is invoked.
      on_completion: Callback to invoke when ``max_results`` results
          arrived at the barrier.
docstr: Notify barrier that a result successfully arrived.
  
  This will count against the ``max_results`` limit. The received result
  will be included in a call to :meth:`get_results`.
  
  Args:
      *data: Result data to be cached. Can be obtained via :meth:`get_results`.
docstr_tok: ["Notify","barrier","that","a","result","successfully","arrived",".","This","will","count","against","the","``","max_results","``","limit",".","The","received","result","will","be","included","in","a","call","to",":","meth",":","`","get_results","`",".","Args",":","*","data",":","Result","data","to","be","cached",".","Can","be","obtained","via",":","meth",":","`","get_results","`","."]
code: def arrive(self, *data):
      """Notify barrier that a result successfully arrived.
  
      This will count against the ``max_results`` limit. The received result
      will be included in a call to :meth:`get_results`.
  
      Args:
          *data: Result data to be cached. Can be obtained via :meth:`get_results`.
  
      """
      if len(data) == 1:
          data = data[0]
  
      self._results.append(data)
      self._check_completion()
  
file_path: ray/python/ray/air/execution/_internal/barrier.py
imports: from typing import Any, Callable, List, Optional, Tuple
label_desc: Use image node_id 2 for calling the Barrier obj's underlying member method code with example usage: obj.arrive() without return types