def put(self, item, block=True, timeout=None):
        """Adds an item to the queue.

        Uses polling if block=True, so there is no guarantee of order if
        multiple producers put to the same full queue.

        Raises:
            Full if the queue is full and blocking is False.
        """
        if self.maxsize <= 0:
            self.actor.put.remote(item)
        elif not block:
            if not ray.get(self.actor.put.remote(item)):
                raise Full
        elif timeout is None:
            # Polling
            # Use a not_full condition variable or promise?
            while not ray.get(self.actor.put.remote(item)):
                # Consider adding time.sleep here
                pass
        elif timeout < 0:
            raise ValueError("'timeout' must be a non-negative number")
        else:
            endtime = time.time() + timeout
            # Polling
            # Use a condition variable or switch to promise?
            success = False
            while not success and time.time() < endtime:
                success = ray.get(self.actor.put.remote(item))
            if not success:
                raise Full
def put ( self , item , block = True , timeout = None ) : if self . maxsize <= 0 : self . actor . put . remote ( item ) elif not block : if not ray . get ( self . actor . put . remote ( item ) ) : raise Full elif timeout is None : while not ray . get ( self . actor . put . remote ( item ) ) : pass elif timeout < 0 : raise ValueError ( "'timeout' must be a non-negative number" ) else : endtime = time . time ( ) + timeout success = False while not success and time . time ( ) < endtime : success = ray . get ( self . actor . put . remote ( item ) ) if not success : raise Full
Adds an item to the queue.

        Uses polling if block=True, so there is no guarantee of order if
        multiple producers put to the same full queue.

        Raises:
            Full if the queue is full and blocking is False.