Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in progress #131

Merged
merged 77 commits into from
Aug 8, 2024
Merged

Work in progress #131

merged 77 commits into from
Aug 8, 2024

Conversation

eldadfux
Copy link
Member

@eldadfux eldadfux commented Apr 4, 2024

No description provided.

$this->server = new SwooleServer($host, $port);
$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?

@@ -135,18 +116,25 @@ class Http
* @param Adapter $server
* @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?

*/
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
4 checks passed
@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.

5 participants