Comments (5)
I don't think there is a need to port anything right now, because that would only complicate things. TBH, I'd like to get rid of current support for Doctrine Entity Manager too. I'm currently working on a more flexible configuration with the ability to dynamically attach handlers to different server events, so anyone could easily attach their own features by just implementing the interface.
Example configuration will look like this:
services:
MyCustomRequestHandler:
class: Vendor/RequestHandlers/MyCustomRequestHandler
swoole:
server:
listeners:
- id: http
host: localhost
protocol: tcp_dualstack
port: 9501
handlers:
request:
# predefined request handlers
- symfonyRequestHandler
- id: 'MyCustomRequestHandler' # reference to service in Symfony DI container
priority: 200
workerStart:
- #...
# predefined listener
- id: api
# predefined listener with some changes
- id: websocket
tls:
enabled: true
key: 'key.pem'
cert: 'cert.pem'
ca: 'ca.pem'
Class Vendor/RequestHandlers/MyCustomRequestHandler
could be even in user-space or in another Symfony bundle. It will just need to implement RequestHandlerInterface
.
I'm working on these features on branch feat/dynamic-listeners
if you'd like to try.
To summarize all of that:
- There is no need to port anything regarding Doctrine project inside this bundle
- There will be an easier configuration of custom event handlers for Swoole server's events (like handling request, tasks, etc.) so anyone could add the things they like
- What I'm really interested in the future is the documentation how to easily integrate external bundles, like yours @Rastusik
from swoole-bundle.
I think I didn't explain clearly what I meant. My point was to remove doctrine code from this bundle and create something like a bridge, or what you call a custom request handler to call the doctrine code from this bundle: https://github.com/pixelfederation/doctrine-resettable-em-bundle . I think it is quite similar to your suggestion and maybe we should work out the details. Or do you see a bigger difference?
from swoole-bundle.
Yeah, I can agree to that, apart from removing things. I'd like to keep backward compatibility for some time, then deprecate and eventually remove it. Because it won't block us to introduce a new feature.
from swoole-bundle.
Ok, the removal can be postponed, no problem. So are you ok with me making a pull request for the mentioned integration? If yes, should I work with the feat/dynamic-listeners
branch then?
from swoole-bundle.
Nope, as usual you should work with develop
.
from swoole-bundle.
Related Issues (20)
- [ASK] Is possible to support PHP 7.2.X HOT 1
- Introduce rectorphp / rector in CI Pipeline
- hot reload not work HOT 1
- docs: Update README.md
- Symfony (http foundation) request->getRequestUri() doesn't contain query string HOT 4
- The bundle seems (too) dependent to Doctrine ORM
- Fix CI: release-version script
- Introduce Infection in CI Pipeline
- Your work is a millennium job LOL HOT 2
- Unable to upgrade to v0.8.3 on PHP 8.0 due to assertion BC break HOT 4
- http response is unavailable HOT 1
- Different Voter Result HOT 2
- Lots of timeout when fetching items from database using doctrine HOT 4
- Bundles seems to skip firewalls HOT 6
- when require ODM
- Use cooperative scheduling in request handling by enabling swoole coroutine hooks for IO functions HOT 2
- Add setting for task_enable_coroutine
- pid_file config does not work
- Some error's do not log.
- Reload does not work with opcache_enabled_cli
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swoole-bundle.