@param int $kernelMemory

@return Client
548040
public function setKernelMemory(int $kernelMemory)
    {
        $this->kernelMemory = $kernelMemory;

        $this->hostConfig = array_merge($this->hostConfig, ['KernelMemory' => $kernelMemory]);

        return $this;
    }
948022
private function _kernel()
    {
        if (CommonFunctions::executeProgram('uname', '-rvm', $ret)) {
            foreach ($this->readdmesg() as $line) {
                if (preg_match('/kernel: MINIX (\d+\.\d+\.\d+)\. \((.+)\)/', $line, $ar_buf)) {
                    $branch = $ar_buf[2];
                    break;
                }
            }
            if (isset($branch))
               $this->sys->setKernel($ret.' ('.$branch.')');
            else
               $this->sys->setKernel($ret);
        }
    }
1081152
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $puppetDbClient = new Client();

        $options = $serviceLocator->get('KmbPuppetDb\Options\ModuleOptions');

        $httpClient = $serviceLocator->get('KmbPuppetDb\Http\Client');
        $httpClient->setOptions($options->getHttpOptions());

        $puppetDbClient->setHttpClient($httpClient);
        $puppetDbClient->setOptions($options);
        $puppetDbClient->setLogger($serviceLocator->get('Logger'));

        return $puppetDbClient;
    }
251209
def get_kernel_message(self, timeout=None, stream='iopub'):
        
        return self.kernel.get_message(stream, timeout=timeout)
469598
public MemcachedClient build() throws IOException {
    XMemcachedClient memcachedClient;
    // kestrel protocol use random session locator.
    if (this.commandFactory.getProtocol() == Protocol.Kestrel) {
      if (!(this.sessionLocator instanceof RandomMemcachedSessionLocaltor)) {
        log.warn(
            "Recommend to use `net.rubyeye.xmemcached.impl.RandomMemcachedSessionLocaltor` as session locator for kestrel protocol.");
      }
    }
    if (this.weights == null) {
      memcachedClient = new XMemcachedClient(this.sessionLocator, this.sessionComparator,
          this.bufferAllocator, this.configuration, this.socketOptions, this.commandFactory,
          this.transcoder, this.addressMap, this.stateListeners, this.authInfoMap,
          this.connectionPoolSize, this.connectTimeout, this.name, this.failureMode);

    } else {
      if (this.addressMap == null) {
        throw new IllegalArgumentException("Null Address map");
      }
      if (this.addressMap.size() > this.weights.length) {
        throw new IllegalArgumentException("Weights Array's length is less than server's number");
      }
      memcachedClient = new XMemcachedClient(this.sessionLocator, this.sessionComparator,
          this.bufferAllocator, this.configuration, this.socketOptions, this.commandFactory,
          this.transcoder, this.addressMap, this.weights, this.stateListeners, this.authInfoMap,
          this.connectionPoolSize, this.connectTimeout, this.name, this.failureMode);
    }
    this.configureClient(memcachedClient);
    return memcachedClient;
  }
306312
protected function getResultService(\core_kernel_classes_Resource $delivery)
    {
        /**
         * @var $ResultServiceWrapper ResultServiceWrapper
         */
        $ResultServiceWrapper = $this->getServiceManager()->get(ResultServiceWrapper::SERVICE_ID);

        $resultsService = $ResultServiceWrapper->getService();
        $implementation = $resultsService->getReadableImplementation($delivery);
        $resultsService->setImplementation($implementation);
        return $resultsService;
    }
607075
public function run(ContextInterface $context, callable $kernel)
    {
        if (empty($this->head)) {
            return $this->handleResult($context, call_user_func($kernel, $context));
        }

        $this->kernel = $kernel;

        /** @var callable $start */
        $start = $this->head;
        $context = $start($context);

        $this->kernel = null;

        return $context;
    }
1059160
public function boot(): KernelInterface
    {
        if (! $this->isBooted) {
            foreach ($this->serviceProviders as $provider) {
                $this->bootProvider($provider);
            }
            $this->isBooted = true;
        }

        return $this;
    }
58133
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new PuppetModule();

        /** @var ClientInterface $pmProxyClient */
        $pmProxyClient = $serviceLocator->get('KmbPmProxy\Client');
        $service->setPmProxyClient($pmProxyClient);

        /** @var PuppetModuleServiceOptionsInterface $options */
        $options = $serviceLocator->get('KmbPmProxy\Options\ModuleOptions');
        $service->setOptions($options);

        return $service;
    }
1333911
protected function getMemory(): ?Obj
	{
		$memory = null;
		$meminfo = $this->readFile('/proc/meminfo');
		if ($meminfo) {
			$bufer = preg_split("/\n/", $meminfo, -1, PREG_SPLIT_NO_EMPTY);
			$memory = new Obj;

			foreach ($bufer as $buf) {
				if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
					$memory->total = ((float) $ar_buf[1]) * 1024;
				} elseif (preg_match('/^MemFree:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
					$memory->free = ((float) $ar_buf[1]) * 1024;
				} elseif (preg_match('/^Cached:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
					$memory->cache = ((float) $ar_buf[1]) * 1024;
				} elseif (preg_match('/^Buffers:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
					$memory->buffer = ((float) $ar_buf[1]) * 1024;
				}
			}
			$memory->used = $memory->total - $memory->free;

			if ($memory->cache !== null && $memory->buffer !== null) {
				$memory->application = $memory->used - $memory->cache - $memory->buffer;
			}

			$memory->swap = [];
			$swaps = preg_split("/\n/", $this->readFile('/proc/swaps'), -1, PREG_SPLIT_NO_EMPTY);
			unset($swaps[0]);
			foreach ($swaps as $swap) {
				$ar_buf = preg_split('/\s+/', $swap, PREG_BAD_UTF8_OFFSET_ERROR);
				$swap = new Obj;
				$swap->mount = $ar_buf[0];
				$swap->name = 'SWAP';
				$swap->total = $ar_buf[2] * 1024;
				$swap->used = $ar_buf[3] * 1024;
				$swap->free = $swap->total - $swap->used;
				$memory->swap[] = $swap;
			}
		}
		return $memory;
	}
977864
protected function seedMiddlewareStack(callable $kernel = null)
    {
        if (!is_null($this->tip)) {
            throw new RuntimeException('MiddlewareStack can only be seeded once.');
        }
        if ($kernel === null) {
            $kernel = $this;
        }
        $this->tip = $kernel;
    }
904536
private function _getClient(): ClientInterface
    {
        if (! $this->client instanceof ClientInterface) $this->client = new Client($this->clientConfig);
        return $this->client;
    }
830174
public function setMemorySwappiness(int $memorySwappiness)
    {
        $this->memorySwappiness = $memorySwappiness;

        $this->hostConfig = array_merge($this->hostConfig, ['MemorySwappiness ' => $memorySwappiness]);

        return $this;
    }
227661
protected function _memory()
    {
        if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
            $bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($bufe as $buf) {
                if (preg_match('/^MemTotal:\s+(\d+)\s*kB/i', $buf, $ar_buf)) {
                    $this->sys->setMemTotal($ar_buf[1] * 1024);
                } elseif (preg_match('/^MemFree:\s+(\d+)\s*kB/i', $buf, $ar_buf)) {
                    $this->sys->setMemFree($ar_buf[1] * 1024);
                } elseif (preg_match('/^Cached:\s+(\d+)\s*kB/i', $buf, $ar_buf)) {
                    $this->sys->setMemCache($ar_buf[1] * 1024);
                } elseif (preg_match('/^Buffers:\s+(\d+)\s*kB/i', $buf, $ar_buf)) {
                    $this->sys->setMemBuffer($ar_buf[1] * 1024);
                }
            }
            $this->sys->setMemUsed($this->sys->getMemTotal() - $this->sys->getMemFree());
            // values for splitting memory usage
            if ($this->sys->getMemCache() !== null && $this->sys->getMemBuffer() !== null) {
                $this->sys->setMemApplication($this->sys->getMemUsed() - $this->sys->getMemCache() - $this->sys->getMemBuffer());
            }
            if (CommonFunctions::rfts('/proc/swaps', $sbuf, 0, 4096, false)) {
                $swaps = preg_split("/\n/", $sbuf, -1, PREG_SPLIT_NO_EMPTY);
                unset($swaps[0]);
                foreach ($swaps as $swap) {
                    $ar_buf = preg_split('/\s+/', $swap, 5);
                    $dev = new DiskDevice();
                    $dev->setMountPoint($ar_buf[0]);
                    $dev->setName("SWAP");
                    $dev->setTotal($ar_buf[2] * 1024);
                    $dev->setUsed($ar_buf[3] * 1024);
                    $dev->setFree($dev->getTotal() - $dev->getUsed());
                    $this->sys->setSwapDevices($dev);
                }
            }
        }
    }
865098
public function getRuntime( core_kernel_classes_Resource $assembly) {
        return $this->getServiceLocator()->get(RuntimeService::SERVICE_ID)->getRuntime($assembly->getUri());
    }
539330
public function register(KernelInterface $kernel): void
    {
        /*
        $kernel[ServerRequestCreatorInterface::class] = function ($c) {
            $requestCreator = new ServerRequestCreator(
                $c[ServerRequestFactoryInterface::class],
                $c[UriFactoryInterface::class],
                $c[UploadedFileFactoryInterface::class],
                $c[StreamFactoryInterface::class]);

            return $requestCreator->fromGlobals();
        };*/


        $kernel->closure(ServerRequestCreatorInterface::class, function (ServerRequestFactoryInterface $serverRequestFactory, UriFactoryInterface $uriFactory, UploadedFileFactoryInterface $uploadedFileFactory, StreamFactoryInterface $streamFactory) {
            $requestCreator = new ServerRequestCreator(
                $serverRequestFactory,
                $uriFactory,
                $uploadedFileFactory,
                $streamFactory);

            return $requestCreator->fromGlobals();
        });



        // *** register alias ***
        $kernel->alias(ServerRequestCreator::class, ServerRequestCreatorInterface::class);
        $kernel->alias('request', ServerRequestCreatorInterface::class);
        /*
        $kernel[ServerRequestCreator::class] = function ($c) {
            return $c->get(ServerRequestCreatorInterface::class);
        };

        $kernel['request'] = function ($c) {
            return $c->get(ServerRequestCreatorInterface::class);
        };*/
    }
666115
public function register(KernelInterface $kernel): void
    {
        // register router object
        /*
        $kernel[RouterInterface::class] = function ($c) {
            $router = new Router();

            $router->setBasePath($c->config['app.settings.basePath'] ?? '/');

            // TODO : aller chercher la responsefactory directement dans le container plutot que de faire un new ResponseFactory !!!!
            // TODO : aller chercher la controllerResolver directement dans le container plutot que de faire un new !!!! ca permettra de faire un override de cette classe si l'utilisateur souhaite redéfinir le resolver.
            $router->setStrategy(new ApplicationStrategy(new ResponseFactory(), new ControllerResolver($c)));

            return $router;
        };*/

        $kernel->closure(RouterInterface::class, function () use ($kernel) {
            $router = new Router();

            $router->setBasePath($kernel->getConfig()['app.settings.basePath'] ?? '/');

            // TODO : aller chercher la responsefactory directement dans le container plutot que de faire un new ResponseFactory !!!!
            // TODO : aller chercher la controllerResolver directement dans le container plutot que de faire un new !!!! ca permettra de faire un override de cette classe si l'utilisateur souhaite redéfinir le resolver.
            $router->setStrategy(new ApplicationStrategy(new ResponseFactory(), new ControllerResolver($kernel)));

            return $router;
        });

        // add alias
        $kernel->alias('router', RouterInterface::class);
        /*
        $kernel['router'] = function ($c) {
            return $c->get(RouterInterface::class);
        };*/
    }