Comments (6)
Is it possible to then just create "polyfill" and use it when the extension is not available? Even if it is slow, it's better than nothing.
from php-zmq.
First, the performance impact would be huge in many (most?) situations. This isn't considering PHP's performance compared to native as much as the fact that standard libzmq handles io in optimised threads, where pure PHP would at best be a single thread with non-blocking sockets. This fact alone also means that it isn't possible to follow zmqs official specs. In the future extensions like pth or pthreads could be used to do this in PHP userspace but currently both extensions have significant performance issues with intra-thread communication. Outside of this fact, yes it is possible. Search "PHP zmtp" and you can find limited examples of pure PHP scripts handling at least pub/sub and push/pull using standard PHP streams.
from php-zmq.
This should be entirely possible but I can see it creating problems when used. For example, if the underlying framework makes it impossible for a consumer to keep up with a producer it's sure to fail.
from php-zmq.
I think it's a good idea though as long as users understand the limitations
from php-zmq.
One way or the other: a possible pure php polyfill for php-zmq should be maintained in its own project.
Please reopen, if still relevant.
from php-zmq.
It's entirely possible to set up a standard system socket using PHP, and entirely possible to process incoming/outgoing packets per zmtp specifications using PHP - it's just not possible to process the packets fast enough to work once put under any type of real load. This isn't a PHP issue. The polyfill WOULD be able to effectively keep-up with C (Java, etc) based implementations if they were using the same single-threaded/generic socket design.
from php-zmq.
Related Issues (20)
- New release HOT 3
- segfault on 32-bit with 7.4.0RC1 HOT 3
- Fedora 30 build error HOT 9
- error: unable to open output file '.libs/zmq.o': 'Permission denied'
- How to install it on debian 9? HOT 1
- Create tags/releases again HOT 2
- PHP 7.4 on Debian 9
- Server Response Type
- Installation does not work. I need help. ( ubuntu20.04 - php8.0.3 ) HOT 10
- php7.4 / php7.3 on windows where I can found ZMQ DLL HOT 2
- PHP 8.1 windows builds? HOT 28
- Make breaks with C99
- zmq.so for arm64 on mac silicon m1 HOT 2
- UDP ZMQ_RADIO ZMQ_DISH
- http://snapshot.zero.mq/ does not respond
- Longevity of php-zmq
- }|}|}|}|}|}|}|}|}|}|}|}\\
- Arg mismatch causing fatal error when debugging with --enable-debug
- alpine package php8-pecl-zmq missing architecture x86_64
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 php-zmq.