Skip to content

Conversation

@eldadfux
Copy link
Member

@eldadfux eldadfux commented Apr 4, 2024

No description provided.

$this->server->set(\array_merge($settings, [
'enable_coroutine' => true
'open_http2_protocol' => true,
// 'http_compression' => true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable back.

Copy link
Contributor

@lohanidamodar lohanidamodar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left few comments

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be we should remove this file

Comment on lines 22 to 36
'open_http2_protocol' => true,
// 'http_compression' => true,
// 'http_compression_level' => 6,

// Server
// 'log_level' => 2,
'dispatch_mode' => 3,
'worker_num' => $workerNumber,
'reactor_num' => swoole_cpu_num() * 2,
'task_worker_num' => $workerNumber,
'open_cpu_affinity' => true,

// Coroutine
'enable_coroutine' => true,
'max_coroutine' => 300000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we want to allow user to override these values?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do allow.

*
* @return array
*/
public static function getRoutes(): array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we remove this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used anywhere.

unset(self::$resourcesCallbacks[$context]);
}
$this->server->onRequest(function ($request, $response) {
$context = clone $this->container;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloning twice

}, [], $context);
\call_user_func_array($error->getAction(), $this->getArguments($error, $context, [], $request->getParams()));
$dependency = new Dependency();
$this->container->set(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this error be set on context ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I follow, which error?

* @param string $timezone
*/
public function __construct(Adapter $server, string $timezone)
public function __construct(Adapter $server, Container $container, string $timezone)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make container optional and auto initialize if not provided?

*
* @throws Exception
*/
public static function setResource(string $name, callable $callback, array $injections = [], string $context = 'utopia'): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not also provide the setResource so that people can still set dependency using this method, but internally use the container to set these dependencies? I still like having this way to set resource here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can now do getContainer->set();

@christyjacob4 christyjacob4 merged commit d1e9674 into feat-framework-v2 Aug 8, 2024
@christyjacob4 christyjacob4 deleted the feat-di-upgrade branch August 8, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants