@Nullable
	final T blockingGet(long timeout, TimeUnit unit) {
    """
	Block until the first value arrives and return it, otherwise
	return null for an empty source and rethrow any exception.
	
	@param timeout the timeout to wait
	@param unit the time unit
	
	@return the first value or null if the source is empty
    """
		if (Schedulers.isInNonBlockingThread()) {
			throw new IllegalStateException("block()/blockFirst()/blockLast() are blocking, which is not supported in thread " + Thread.currentThread().getName());
		}
		if (getCount() != 0) {
			try {
				if (!await(timeout, unit)) {
					dispose();
					throw new IllegalStateException("Timeout on blocking read for " + timeout + " " + unit);
				}
			}
			catch (InterruptedException ex) {
				dispose();
				RuntimeException re = Exceptions.propagate(ex);
				//this is ok, as re is always a new non-singleton instance
				re.addSuppressed(new Exception("#block has been interrupted"));
				throw re;
			}
		}

		Throwable e = error;
		if (e != null) {
			RuntimeException re = Exceptions.propagate(e);
			//this is ok, as re is always a new non-singleton instance
			re.addSuppressed(new Exception("#block terminated with an error"));
			throw re;
		}
		return value;
	}
@Nullable
	final T blockingGet(long timeout, TimeUnit unit) {
		if (Schedulers.isInNonBlockingThread()) {
			throw new IllegalStateException("block()/blockFirst()/blockLast() are blocking, which is not supported in thread " + Thread.currentThread().getName());
		}
		if (getCount() != 0) {
			try {
				if (!await(timeout, unit)) {
					dispose();
					throw new IllegalStateException("Timeout on blocking read for " + timeout + " " + unit);
				}
			}
			catch (InterruptedException ex) {
				dispose();
				RuntimeException re = Exceptions.propagate(ex);
				//this is ok, as re is always a new non-singleton instance
				re.addSuppressed(new Exception("#block has been interrupted"));
				throw re;
			}
		}

		Throwable e = error;
		if (e != null) {
			RuntimeException re = Exceptions.propagate(e);
			//this is ok, as re is always a new non-singleton instance
			re.addSuppressed(new Exception("#block terminated with an error"));
			throw re;
		}
		return value;
	}
@ Nullable final T blockingGet ( long timeout , TimeUnit unit ) { if ( Schedulers . isInNonBlockingThread ( ) ) { throw new IllegalStateException ( "block()/blockFirst()/blockLast() are blocking, which is not supported in thread " + Thread . currentThread ( ) . getName ( ) ) ; } if ( getCount ( ) != 0 ) { try { if ( ! await ( timeout , unit ) ) { dispose ( ) ; throw new IllegalStateException ( "Timeout on blocking read for " + timeout + " " + unit ) ; } } catch ( InterruptedException ex ) { dispose ( ) ; RuntimeException re = Exceptions . propagate ( ex ) ; //this is ok, as re is always a new non-singleton instance re . addSuppressed ( new Exception ( "#block has been interrupted" ) ) ; throw re ; } } Throwable e = error ; if ( e != null ) { RuntimeException re = Exceptions . propagate ( e ) ; //this is ok, as re is always a new non-singleton instance re . addSuppressed ( new Exception ( "#block terminated with an error" ) ) ; throw re ; } return value ; }
Block until the first value arrives and return it, otherwise
return null for an empty source and rethrow any exception.

@param timeout the timeout to wait
@param unit the time unit

@return the first value or null if the source is empty
Block until the first value arrives and return it otherwise return null for an empty source and rethrow any exception .