Skip to content

Work in progress - #131

Merged
christyjacob4 merged 77 commits into
feat-framework-v2from
feat-di-upgrade
Aug 8, 2024
Merged

Work in progress#131
christyjacob4 merged 77 commits into
feat-framework-v2from
feat-di-upgrade

Conversation

@eldadfux

Copy link
Copy Markdown
Member

No description provided.

Comment threadsrc/Http/Adapter/Swoole/Server.php Outdated
$this->server->set(\array_merge($settings, [
'enable_coroutine' => true
'open_http2_protocol' => true,
// 'http_compression' => true,

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Enable back.

@lohanidamodarlohanidamodar left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread.vscode/launch.json

Copy link
Copy Markdown
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 threadsrc/Http/Adapter/Swoole/Server.php Outdated
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
Copy Markdown
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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

We do allow.

Comment threadsrc/Http/Router.php
*
* @return array
*/
public static function getRoutes(): array

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Not used anywhere.

Comment threadsrc/Http/Http.php Outdated
unset(self::$resourcesCallbacks[$context]);
}
$this->server->onRequest(function ($request, $response) {
$context = clone $this->container;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cloning twice

Comment threadsrc/Http/Http.php Outdated
}, [], $context);
\call_user_func_array($error->getAction(), $this->getArguments($error, $context, [], $request->getParams()));
$dependency = new Dependency();
$this->container->set(

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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?

Comment threadsrc/Http/Http.php
* @param string $timezone
*/
public function __construct(Adapter $server, string $timezone)
public function __construct(Adapter $server, Container $container, string $timezone)

Copy link
Copy Markdown
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?

Comment threadsrc/Http/Http.php
*
* @throws Exception
*/
public static function setResource(string $name, callable $callback, array $injections = [], string $context = 'utopia'): void

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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-v2Aug 8, 2024
@christyjacob4
christyjacob4 deleted the feat-di-upgrade branch August 8, 2024 14:46
Sign up for freeto 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.

5 participants

@eldadfux@lohanidamodar@christyjacob4@byawitz@Meldiron