Static constructor - start processor

@param array|object $payload
@param Parameters $parameters
@param LoggerInterface $logger

@return mixed
@throws Exception
358238
public static function process($payload, Parameters $parameters, LoggerInterface $logger) {

        try {

            $processor = new JsonProcessor($payload, $parameters, $logger);

            $return = $processor->run();

        } catch (Exception $e) {

            throw $e;

        }

        return $return;

    }
870110
public static function Start ($output_callback = self::HANDLER_DEFAULT, $chunk_size = 0, $erase = null) {
		return ($erase !== self::HANDLER_DEFAULT) ? ob_start($output_callback, $chunk_size, $erase) : ob_start($output_callback, $chunk_size);
	}
791086
public function setLogger(LoggerInterface $logger)
	{
		$this->logger = $logger;

		// Also update the logger on all current gateways in our pool
		foreach ($this->gatewayPool as $gateway) {
			$gateway->setLogger($logger);
		}
	}
555296
public function setLogger(LoggerInterface $logger)
    {
        if ($this->handler) {
            throw new AlreadyBuildedException('The handler already builded.');
        }

        $this->logger = $logger;

        return $this;
    }
228892
public function setDefaultLogging(array $parameters)
    {
        if (! class_exists('\Monolog\Logger')) {
            //@codeCoverageIgnoreStart
            throw new \RuntimeException(
                'Could not find any logger set and the monolog logger library was not found
                to provide a default, you have to  set a custom logger on the client or
                have you forgot adding monolog to your composer.json?'
            );
            //@codeCoverageIgnoreEnd
        } else {
            $logger = new Logger('google-movie-client');
            $logger->pushHandler($parameters['handler']);
        }

        if ($this->getAdapter() instanceof GuzzleAdapter) {
            $subscriber = new LogSubscriber($logger);
            $this->getAdapter()->getClient()->getEmitter()->attach($subscriber);
        }

        return $this;
    }
886512
public void start(String[] args) {
        try {
            processEnvironmentOptions();
            processCommandLineOptions(args);
            initializeLogging();
            validateOptions();
            final ChaincodeID chaincodeId = ChaincodeID.newBuilder().setName(this.id).build();
            final ManagedChannelBuilder<?> channelBuilder = newChannelBuilder();
            final Handler handler = new Handler(chaincodeId, this);
            new ChaincodeSupportStream(channelBuilder, handler::onChaincodeMessage, handler::nextOutboundChaincodeMessage);
        } catch (Exception e) {
            logger.fatal("Chaincode could not start", e);
        }
    }
819365
protected function instantiateLogger(string $loggerObjectName, $backendObjectNames, array $backendOptions = []): LoggerInterface
    {
        $logger = new $loggerObjectName;
        if (is_array($backendObjectNames)) {
            foreach ($backendObjectNames as $i => $backendObjectName) {
                if (isset($backendOptions[$i])) {
                    $backend = new $backendObjectName($backendOptions[$i]);
                    $logger->addBackend($backend);
                }
            }
        } else {
            $backend = new $backendObjectNames($backendOptions);
            $logger->addBackend($backend);
        }

        $logger = $this->injectAdditionalDependencies($logger);
        return $logger;
    }
219165
protected function callHandler(callable $handler, $payload)
    {
        try {
            return $handler($payload);
        } catch (\Exception $e) {
            if (property_exists($this, 'app') && $this->app instanceof ServiceContainer) {
                $this->app['logger']->error($e->getCode().': '.$e->getMessage(), [
                    'code' => $e->getCode(),
                    'message' => $e->getMessage(),
                    'file' => $e->getFile(),
                    'line' => $e->getLine(),
                ]);
            }
        }
    }
198527
public function createExecutor($requestHandler)
    {
        if (is_callable($requestHandler)) {
            $requestHandler = new CallbackRequestHandler($requestHandler);
        } elseif (!$requestHandler instanceof RequestHandlerInterface) {
            throw new \InvalidArgumentException(sprintf(
                'Expected argument of type "RequestHandlerInterface" or "callable", "%s" given',
                is_object($requestHandler) ? get_class($requestHandler) : gettype($requestHandler))
            );
        }

        $executor = new Executor($this->getServer(), $requestHandler, $this->getExceptionHandler());
        $executor->setLogger($this->getLogger());

        return $executor;
    }
1005791
public function addStartButton(string $payload): self
    {
        $this->isValidString($payload, 1000);

        $this->startButton = [
            'payload' => $payload,
        ];

        return $this;
    }
1043424
public static function create(array $options = [], $logger = Client::LOG_NONE)
    {
        $oauth = new Oauth1([
            'token_secret' => '',
            'consumer_key' => $options['consumerKey'],
            'consumer_secret' => $options['consumerSecret']
        ]);

        $stack = HandlerStack::create();
        $stack->push($oauth);

        if (!empty($logger)) {
            $stack->push(
                Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG))
            );
        }

        $client = new \GuzzleHttp\Client([
            'base_uri' => self::$url,
            'handler' => $stack,
            'auth' => 'oauth'
        ]);

        $mapper = new ResultObjectMapper();

        return new self(
            new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)),
            new Validator(Validation::createValidator()),
            $mapper
        );
    }
928840
public static function init(PsrLogger $psrLogger = null)
    {
        self::$psrLogger = $psrLogger ?: (new LoggingClient())
            ->psrLogger(self::DEFAULT_LOGNAME, [
                'batchEnabled' => true,
                'debugOutput' => true,
                'batchOptions' => [
                    'numWorkers' => 2
                ]
            ]);
        register_shutdown_function([self::class, 'shutdownHandler']);
        set_exception_handler([self::class, 'exceptionHandler']);
        set_error_handler([self::class, 'errorHandler']);
    }
1065565
final public function process($payload)
    {
        $payload = $this->processor->processStack($payload, $this->stack);

        if ( $this->next instanceof PipeChainInterface ) {
            $payload = $this->next->process($payload);
        }

        return $payload;
    }
856780
public static void start(final Logger logger, final Logger auditor, final HttpServletRequest request) {
        start(logger, auditor, request, null);
    }
820652
public static function create(LoggerInterface $logger, array $options = [])
    {
        $context = new \ZMQContext();
        $socket = $context->getSocket(\ZMQ::SOCKET_REQ);
        $socket->setSockOpt(\ZMQ::SOCKOPT_LINGER, $options['linger']);
        $socket->connect(sprintf(
            '%s://%s:%s', $options['protocol'], $options['host'], $options['port']
        ));

        return new static($socket, $logger);
    }
423442
function start(payload) {
  for (var id in this.callbacks) {
    this.isPending[id] = false;
    this.isHandled[id] = false;
  }
  this.isDispatching = true;
  this.pendingPayload = payload;
}
854075
public static function logException (LoggerInterface $logger, Exception $exception)
  {
    $logger->error (sprintf ("%s, at %s(%s)", $exception->getMessage (),
      ErrorConsole::shortFileName ($exception->getFile ()), $exception->getLine ()));
  }