Start resovling.
@param  mixed    $value
@param  bool     $wait
@param  mixed    $throw  Used for Co::async() overrides.
@param  mixed    If $wait, return resolved value.
764970
private function start($value, $wait = true, $throw = null)
    {
        $return = null;
        // For convenience, all values are wrapped into generator
        $con = YieldableUtils::normalize($this->getRootGenerator($throw, $value, $return));
        $promise = $this->processGeneratorContainerRunning($con);
        if ($promise instanceof ExtendedPromiseInterface) {
            // This is actually 100% true; just used for unwrapping Exception thrown.
            $promise->done();
        }
        // We have to wait $return only if $wait
        if ($wait) {
            $this->pool->wait();
            return $return;
        }
    }
955949
public function setValue($value)
  {
    if (is_null($value)) {
      $this->value = null;
    } else if (is_bool($value)) {
      $this->value = $value;
    } else if (is_numeric($value)) {
      if ($value == 0) {
        $this->value = false;
      } else{
        $this->value = true;
      }
    } else if ($value == '') {
      $this->value = null;
    } else{
      throw new \Exception(sprintf('Valeur %s non appliquable a un composant de type Boolean', $value));
    }
  }
66607
public function invoke($object, $value)
    {
        if (null !== $value) {
            $this->method->invoke($object, $value);
        }
    }
54780
public function assertIsEmpty($value, $message='%s must not be empty', $exception='Asserts')
    {
        if (isset($value) === false || empty($value)) {
            $this->throwException($exception, $message, $value);
        }
    }
114630
public function execute($value)
    {
        if (!is_array($value) || count($value) != 2) {
            throw new \Exception('Value for number range comparison should have to values');
        }

        $queryBuilder = $this->getQueryBuilder();

        if (!empty($value[0])) {
            $queryBuilder->andHaving(
                $queryBuilder->expr()->gte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_1"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_1",
                    (float) $value[0]
                );
        }

        if (!empty($value[1])) {
            $queryBuilder->andHaving(
                $queryBuilder->expr()->lte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_2"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_2",
                    (float) $value[1]
                );
        }
    }
1058538
public function wait(bool $throwExceptionOnError=true) : PhoreProcResult
    {

        if ($this->proc === null)
            $this->exec();

        $buf = null;
        if ($buf === null) {
            $buf = [];
            foreach ($this->listener as $chanId => $listener) {
                $buf[$chanId] = "";
            }
        }

        while(true) {
            $allPipesClosed = true;
            $noData = true;
            foreach ($buf as $chanId => &$buffer) {
                if ( ! feof($this->pipes[$chanId])) {
                    $allPipesClosed = false;
                    $dataRead = fread($this->pipes[$chanId], 1024 * 32);
                    $dataReadLen = strlen($dataRead);
                    if ($dataReadLen > 0) {
                        $noData = false;
                        if ($this->listener[$chanId] !== null) {
                            ($this->listener[$chanId])($dataRead, $dataReadLen, $this);
                        } else {
                            $buffer .= $dataRead;
                        }
                    }
                }
            }
            if ($allPipesClosed) {
                break;
            }
            if ($noData) {
                usleep(500);
            }
        }

        foreach ($this->listener as $chanId => $listener) {
            if ($listener === null)
                continue;
            $listener(null, null, $this);
            fclose($this->pipes[$chanId]);
        }
        fclose($this->pipes[0]);


        $exitStatus = proc_close($this->proc);
        $errmsg = "";
        if (isset ($buf[2]))
            $errmsg = $buf[2];
        if ($exitStatus !== 0) {
            throw new PhoreExecException("Command '$this->cmd' returned with exit-code $exitStatus: $errmsg", $exitStatus);
        }
        return new PhoreProcResult($exitStatus, $buf);
    }
546963
final public function send($value)
    {
        $this->_lastValueSentIn        = $value;
        $this->_sendInvokedAtLeastOnce = true;

        /*
         * If we've already ran to the first yield statement (from rewind() or key(), for instance), we need
         * to try to move to the next position;
         */
        if ($this->_positionsExecutedCount > 0) {

            $this->_position++;
        }

        return $this->current();
    }
1231770
public function wait(Promise $promise, callable $onProgress = null): ?ExecutionResult
    {
        if (!$this->isThenable($promise)) {
            throw new \InvalidArgumentException(\sprintf('The "%s" method must be call with compatible a Promise.', __METHOD__));
        }
        $wait = true;
        $resolvedValue = null;
        $exception = null;
        /** @var \React\Promise\PromiseInterface $reactPromise */
        $reactPromise = $promise->adoptedPromise;

        $reactPromise->then(function ($values) use (&$resolvedValue, &$wait): void {
            $resolvedValue = $values;
            $wait = false;
        }, function ($reason) use (&$exception, &$wait): void {
            $exception = $reason;
            $wait = false;
        });

        // wait until promise resolution
        while ($wait) {
            if (null !== $onProgress) {
                $onProgress();
            }
            // less CPU intensive without sacrificing the performance
            \usleep(5);
        }

        /** @var \Exception|null $exception */
        if (null !== $exception) {
            throw $exception;
        }

        return $resolvedValue;
    }
1336646
public void start(boolean wait) throws MessagingException {
        Thread connector = new JMSBrokerConnector();
        connector.start();

        if(wait) {
            int maxWait = RETRY_INTERVAL * MAX_RETRIES;
            int waitTime = 0;
            while(!isConnected()) {
                if(waitTime < maxWait) {
                    try {
                        Thread.sleep(100);
                        waitTime += 100;
                    } catch (InterruptedException ie) {
                        Thread.currentThread().interrupt();
                    }
                } else {
                    throw new MessagingException("Timeout reached waiting " +
                                           "for messaging client to start.");
                }
            }
        }
    }
269647
function(value) {
		if (this.resolved) {
			throw new Error('Future resolved more than once');
		}
		this.value = value;
		this.resolved = true;

		var callbacks = this.callbacks;
		if (callbacks) {
			delete this.callbacks;
			for (var ii = 0; ii < callbacks.length; ++ii) {
				try {
					var ref = callbacks[ii];
					if (ref[1]) {
						ref[1](value);
					} else {
						ref[0](undefined, value);
					}
				} catch(ex) {
					// console.log('Resolve cb threw', String(ex.stack || ex.message || ex));
					process.nextTick(function() {
						throw(ex);
					});
				}
			}
		}
	}
1034527
public function fulfill($value = null)
    {
        if (self::PENDING !== $this->state) {
            throw new PromiseAlreadyResolvedException('This promise is already resolved, and you\'re not allowed to resolve a promise more than once');
        }
        $this->state = self::FULFILLED;
        $this->value = $value;
        foreach ($this->subscribers as $subscriber) {
            $this->invokeCallback($subscriber[0], $subscriber[1]);
        }
    }
90579
async def wait(self, container = None):
        '''
        
        '''
        if hasattr(self, '_result'):
            if hasattr(self, '_exception'):
                raise self._exception
            else:
                return self._result
        else:
            ev = await FutureEvent.createMatcher(self)
            if hasattr(ev, 'exception'):
                raise ev.exception
            else:
                return ev.result
987562
public function swi($condition, $value = null) {
		if (null == $value) {
			$this->_switchCondition = null;
			$this->_switchValue = $condition;
		} else  {
			$this->_switchCondition = $condition;
			$this->_switchValue = $value;
		}
	}
1318879
public function complete($value = null)
    {
        if (null !== $this->started) {
            $this->started->reject(new CompletedError());
        }

        $this->delayed->resolve($value);
    }
848693
public function execute($value)
    {
        if (!is_array($value) || count($value) != 2) {
            throw new \Exception('Value for date range comparison should have to values');
        }

        $queryBuilder = $this->getQueryBuilder();

        if (!empty($value[0])) {

            $transformer = new FullTransformer(
                $this->container->getParameter('pedro_teixeira_grid.date.date_format'),
                $this->container->getParameter('locale')
            );
            $date = new \DateTime();
            $transformer->parse($date, $value[0]);

            $queryBuilder->andWhere(
                $queryBuilder->expr()->gte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_1"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_1",
                    $date->format('Y-m-d') . ' 00:00:00'
                );
        }

        if (!empty($value[1])) {

            $transformer = new FullTransformer(
                $this->container->getParameter('pedro_teixeira_grid.date.date_format'),
                $this->container->getParameter('locale')
            );
            $date = new \DateTime();
            $transformer->parse($date, $value[1]);

            $queryBuilder->andWhere(
                $queryBuilder->expr()->lte(
                    $this->getIndex(),
                    ":{$this->getIndexClean()}_2"
                )
            )
                ->setParameter(
                    ":{$this->getIndexClean()}_2",
                    $date->format('Y-m-d') . ' 23:59:59'
                );
        }
    }
676289
public function then(callable $callback, callable $failure = null)
    {
        try {
            return (new ConcurrencyLimiter(
                $this->connection, $this->name, $this->maxLocks, $this->releaseAfter
            ))->block($this->timeout, $callback);
        } catch (LimiterTimeoutException $e) {
            if ($failure) {
                return $failure($e);
            }

            throw $e;
        }
    }
364121
private function getRootGenerator($throw, $value, &$return)
    {
        try {
            if ($throw !== null) {
                $key = $throw ? null : CoInterface::SAFE;
            } else {
                $key = $this->options['throw'] ? null : CoInterface::SAFE;
            }
            $return = (yield $key => $value);
            return;
        } catch (\Throwable $e) {} catch (\Exception $e) {}
        $this->pool->reserveHaltException($e);
    }