Skip to content

Add drift kernel adapter #12

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

Merged
merged 4 commits into from
Feb 2, 2021
Merged

Add drift kernel adapter #12

merged 4 commits into from
Feb 2, 2021

Conversation

kpicaza
Copy link
Member

@kpicaza kpicaza commented Jan 23, 2021

Description

As talked with @mmoreram(DriftPHP lead developer) we will integrate the reactive versión of Antidot with DriftPHP Server:

Comparing to the actual plain ReactPHP server, the Drift server gives us more robustness and some features like static file serving, multi-threading, server logs, request timing... A big step up;- D

Also, this way we can focus on working on more specific framework related features and of course helping in the Driftphp community

@kpicaza kpicaza added enhancement New feature or request dependencies Pull requests that update a dependency file labels Jan 23, 2021
@kpicaza kpicaza added this to the 2.0.0 milestone Jan 23, 2021
@kpicaza kpicaza requested a review from a team January 23, 2021 12:23
@kpicaza kpicaza self-assigned this Jan 23, 2021
composer.json Outdated
@@ -16,6 +16,7 @@
"require": {
"php": "^7.4|^8.0",
"antidot-fw/framework": "^0.1.3",
"drift/server": "@dev",
Copy link
Member

Choose a reason for hiding this comment

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

Is this proper to install unstable dependency for the framework?

Copy link
Member Author

@kpicaza kpicaza Jan 23, 2021

Choose a reason for hiding this comment

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

Thanks @peter279k, Is still worki in progress, Driftphp already does not support PHP8, and the release of drift that allows integrating by using an adapter is not released yet. it must be a stable versión before release.

Copy link
Member Author

@kpicaza kpicaza Jan 23, 2021

Choose a reason for hiding this comment

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

@peter279k maybe it will be better to extract this adapter to a third package, allowing us to run the application both with Drift or with our built-in server. Letting the developers choose what they prefer in the starter(future installer)?

Copy link
Member

@peter279k peter279k Jan 23, 2021

Choose a reason for hiding this comment

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

Just notice that the ^0.1.17 version is supported for the php-8.0.

And the reference is available here.

Choose a reason for hiding this comment

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

You can work with this new version - 0.1.18 - https://github.com/driftphp/server/releases/tag/0.1.18

This server has almost changed it's public API and in case it changes the public API (interface), it will do it in BC mode.

@kpicaza kpicaza force-pushed the drift_server branch 4 times, most recently from 2bd292e to 5c2da89 Compare January 23, 2021 23:48
@kpicaza kpicaza marked this pull request as ready for review January 24, 2021 11:19
@kpicaza
Copy link
Member Author

kpicaza commented Jan 24, 2021

There is one broken dependency in PHP8, I did a PR driftphp/event-loop-utils#1 to update PHP and PHPUnit versions. I think that there is the only blocking thing. Yesterday I test both servers with the forking feature and I can say that the Drift server is at least faster than our built-in server;- D

@kpicaza kpicaza requested a review from peter279k January 24, 2021 11:25
@kpicaza
Copy link
Member Author

kpicaza commented Jan 24, 2021

Another stopper seregazhuk/php-watcher, I'm forked the project and try locally with PHP8 with success, I will open a PR
image

UPDATE PR opened;-D seregazhuk/php-watcher#69

ServerContext $serverContext,
MimeTypeChecker $mimeTypeChecker,
string $rootPath,
?object $filesystem
Copy link

Choose a reason for hiding this comment

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

This should be strict ?FilesystemInterface $filesystem. It doesn't matter if the dependency is not there, the contract should be working as well.

Copy link

Choose a reason for hiding this comment

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

OOps. Nopes, sorry, this is not the method I was talking about :(

ServerContext $serverContext,
OutputPrinter $outputPrinter,
MimeTypeChecker $mimeTypeChecker,
$filesystem = null
Copy link

Choose a reason for hiding this comment

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

Here!

?FilesystemInterface $filesystem

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't like it too much, but this way I can pass psalm checks both in PHP 7.4 and 8

@kpicaza kpicaza merged commit 264fd4e into 2.x.x Feb 2, 2021
@kpicaza kpicaza deleted the drift_server branch February 2, 2021 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants