Do not allow the event to overlap each other.

@param  int  $expiresAt
@return $this

@throws \LogicException
425296
public function withoutOverlapping($expiresAt = 1440)
    {
        if (! isset($this->description)) {
            throw new LogicException(
                "A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'."
            );
        }

        $this->withoutOverlapping = true;

        $this->expiresAt = $expiresAt;

        return $this->skip(function () {
            return $this->mutex->exists($this);
        });
    }
309017
public function whereExpr($expr, $bind = null)
    {
        foreach ($this->queries as $query) {
            $query->whereExpr($expr, $bind);
        }

        return $this;
    }
978956
public function setExpires($expires)
    {
        if (!$expires instanceof \DateTime) {
            // @see https://github.com/bshaffer/oauth2-server-bundle/issues/24
            $dateTime = new \DateTime();
            $dateTime->setTimestamp($expires);
            $expires = $dateTime;
        }

        $this->expires = $expires;

        return $this;
    }
419906
public function listen(ServerSocketContract $serverSocket)
    {
        if ($this->isRunning()) {
            throw new LogicException('Cannot add listening while the server is serving.');
        }

        if ($serverSocket->isBound()) {
            throw new LogicException('The server socket can be bound to server only once.');
        }

        $address = "{$serverSocket->getHost()}:{$serverSocket->getPort()}";

        if (isset($this->serverSockets[$address])) {
            throw new LogicException('The same address has been listened before.');
        }

        $swoolePort = $this->swooleServer->listen(
            $serverSocket->getHost(),
            $serverSocket->getPort(),
            $serverSocket->getSocketType()
        );

        if ($swoolePort == false) {
            $errorCode = $this->swooleServer->getLastError();

            throw new RuntimeException(sprintf(
                'Listen %s%s fail, error code %d', $serverSocket->getHost(),
                $serverSocket->getPort() ? ':'.$serverSocket->getPort() : '', $errorCode
            ), $errorCode);
        }

        $this->serverSockets[$address] = $serverSocket;

        $serverSocket->listen($this, $swoolePort);
    }
1180695
public function setAction($action)
    {
        if (!is_string($action) && !is_callable($action)) {
            throw new \LogicException(sprintf('Route action given "%s" is invalid. String or Callable expected.', gettype($action)));
        }
        $this->action = $action;
        
        return $this;
    }
913474
public function whereExpr($expr, $bind = null)
    {
        $this->_conditions[] = $expr;

        if (is_array($bind)) {
            $this->_bind = array_merge($this->_bind, $bind);
        }

        return $this;
    }
332544
public function setExpireMethod($expire_method)
    {
        $expire_method = strtoupper($expire_method);
        if (!isset(self::getExpungeMethods()[$expire_method])) { 
            throw new \InvalidArgumentException(sprintf('The "%s" expire method is not a valid expire method.', $expire_method));
        }
        $this->expire_method = $expire_method;
        return $this;
    }
1236651
public function setExpirationDate($expirationDate)
    {
        if (is_string($expirationDate)) {
            $expirationDate = new \DateTime($expirationDate);
        }

        $this->expirationDate = $expirationDate;

        return $this;
    }
914314
public function setExpression(string $expr) {
		$this->expression = $expr;
		$this->hasExpression = true;

		return $this;
	}
4752
final public function delete($extraWhereClause = '')
    {
        if (self::RSMODE_CONNECTED_EDIT !== $this->mode) {
            throw new \LogicException('Recordset: The recordset is not on edit mode [current: ' . $this->mode . ']');
        }
        // check the entity is not empty
        if ('' === $this->entity) {
            throw new \LogicException('Recordset: The recordset does not have a valid unique entity');
        }
        $sql = $this->sqlDelete($extraWhereClause);
        $altered = $this->dbal->execute($sql);
        if (0 === $altered) {
            $this->logger->warning(print_r([
                'message' => "Recordset: The statement '$sql' return zero affected rows"
                    . ' but it should delete at least one record',
                'entity' => $this->entity,
                'extraWhereClause' => $extraWhereClause,
                'original' => $this->originalValues,
            ], true));
        }
        return $altered;
    }
141247
private function setExpiration($expires_in)
    {
        $this->expiresAtTimestamp = time() + $expires_in;
        $this->expiresAt = date('Y-m-d H:i:s', time() + $expires_in);
    }
258370
public function manage(Process ...$processes)
    {
        $unbounded = ($this->poolSize < 0);

        foreach ($processes as $process) {
            if (!$unbounded && (--$this->poolSize < 0)) {
                throw new LogicException("PooledExecutor pool size [{$this->poolSize}] exceeded.");
            }

            $this->processes[$process->getPid()] = $process;
        }

        return $this;
    }
1180711
function setExpiresIn($expiry)
    {
        $this->expiresIn = $expiry;
        $this->datetimeExpiration = $this->getDateTimeExpiration();
        return $this;
    }
1324631
public static function expiresAt($expiresAt)
    {
        if (false === $dateTime = DateTime::createFromFormat(DateTime::ATOM, $expiresAt)) {
            throw new InputValidationException('invalid "expires_at"');
        }

        return $dateTime;
    }
345744
public function bind(Server $server)
    {
        if ($this->isBound()) {
            throw new LogicException('Process can be bound to server only once.');
        }

        $this->server = $server;

        $this->dispatchEvent('Bind', $server, $this);
    }
789189
public function remove() {
		$p = $this->getParent();
		if (null == $p) {
			throw new LogicException();
		}
		$p->removeChildAt( $this->getChildIndex() );
		return $this;
	}
882627
public function priority($priority, $retryTimeout = null, $expireAfter = null)
    {
        $this->noEmergencyWithoutRetryOrExpire($priority, $retryTimeout, $expireAfter);

        $this->priority = $priority;
        $this->retry = $retryTimeout;
        $this->expire = $expireAfter;

        return $this;
    }