Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:14
    blacktek opened #210
  • Jan 19 12:21
    bartoszkubicki commented #222
  • Jan 19 09:56
    clue closed #222
  • Jan 19 09:56
    clue commented #222
  • Jan 19 09:55
    clue labeled #222
  • Jan 18 23:21
    CharlotteDunois commented #222
  • Jan 18 23:20
    CharlotteDunois commented #222
  • Jan 18 22:54
    bartoszkubicki edited #222
  • Jan 18 22:54
    bartoszkubicki edited #222
  • Jan 18 22:53
    bartoszkubicki edited #222
  • Jan 18 22:53
    bartoszkubicki edited #222
  • Jan 18 22:50
    bartoszkubicki opened #222
  • Jan 17 17:01
    CharlotteDunois commented #145
  • Jan 17 17:01
    CharlotteDunois commented #145
  • Jan 16 15:40
    Nek- commented #145
  • Jan 16 15:39
    Nek- commented #145
  • Jan 16 12:03
    clue commented #145
  • Jan 16 09:57
    Nek- commented #145
  • Jan 15 19:41
    flybyray edited #221
  • Jan 15 19:35
    flybyray opened #221
Marc Morera
@mmoreram
Do you have ideas about what else could we speak about in the conference?
CFP are welcomed
Charlotte Dunois
@CharlotteDunois
@WyriHaximus https://stackoverflow.com/a/48485134/3885509 Found the back story to that signal :D
Cees-Jan Kiewiet
@WyriHaximus
@CharlotteDunois cool!
Charlotte Dunois
@CharlotteDunois
@WyriHaximus Do you happen to know which libuv version is used on travis (or whatever distro travis uses by default)?
Cees-Jan Kiewiet
@WyriHaximus
@CharlotteDunois no clue tbh
Charlotte Dunois
@CharlotteDunois
I'm shocked
Cees-Jan Kiewiet
@WyriHaximus
Not using Travis for ext-uv and ext-parallel related packages of my own.
But give me a sec
Charlotte Dunois
@CharlotteDunois
You're using travis for testing the ext-uv event loop
:D
Cees-Jan Kiewiet
@WyriHaximus
yeah that's ReactPHP, not my own stuff
But 1.9.1 by the looks of:
Charlotte Dunois
@CharlotteDunois
Alright thanks
I didn't know travis fires off a new build on tag create...
Olatunbosun Egberinde
@bosunski

Are there any limitations to using this: https://github.com/friends-of-reactphp/mysql ?

Since we cannot use PDO in a non blocking environment

Charlotte Dunois
@CharlotteDunois
Yes, most notably it does not support prepared statements. Less notably is it does not support cursors (selective fetching of rows instead of the database sending all "at once").
@bosunski
Olatunbosun Egberinde
@bosunski

Thanks @CharlotteDunois .

However, would anyone advice using this in production at all?

Christian Lück
@clue
@bosunski Yes, I've helped multiple projects using it in production processing millions of records and I'm not aware of any issues in real-world scenarios :+1:
Olatunbosun Egberinde
@bosunski

Thanks @clue ... That's wonderful and encouraging to hear 👍.

I'm currently looking at using this in production, that's why i'm asking the questions- to know some downsides.

Christian Lück
@clue
@bosunski Sure, go for it! Also, make sure to let us know what you find out, we're here to help and also love hearing success stories! 🏅
Charlotte Dunois
@CharlotteDunois
grafik.png
@WyriHaximus I get a segfault when I try to test this branch with code coverage on... both on windows and linux...
Charlotte Dunois
@CharlotteDunois
First core dump on CI was with xdebug and something lead off being something about xdebug and gc collections. After turning it off the test process on the CI still somehow aborts somewhere in the middle without producing a core dump? I don't know, still looking into Ant (what the CI build agent uses to exec build steps) what Result: 139 at the end of the exec output means...
lonaking
@lonaking
Hi,@WyriHaximus brother. I’m looking for the react-php's doc in Chinese. But I got nothing, so I want to let my team translate the doc, Can I do this job?
Charlotte Dunois
@CharlotteDunois
@lonaking reactphp/event-loop#178 related
lonaking
@lonaking
This just a little part of react-php
Cees-Jan Kiewiet
@WyriHaximus
@lonaking From me it's welcome, the only thing I think we can improve on is how to make it easier to find and ensure it's up to date with new releases.
Charlotte Dunois
@CharlotteDunois
@WyriHaximus Hmm... :thinking:
Starting program: /usr/bin/php-zts vendor/phpunit/phpunit/phpunit testp.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

Random seed:   1579376205

.                                                                   1 / 1 (100%)


Time: 77 ms, Memory: 6.00 MB

OK (1 test, 1 assertion)

Program received signal SIGSEGV, Segmentation fault.
destruct_uv_loop_walk_cb (handle=<optimized out>, arg=0x0) at /tmp/pear/temp/uv/php_uv.c:1206
1206    /tmp/pear/temp/uv/php_uv.c: No such file or directory.
(gdb) bt
#0  destruct_uv_loop_walk_cb (handle=<optimized out>, arg=0x0) at /tmp/pear/temp/uv/php_uv.c:1206
#1  0x00007fffec4fa70f in uv_walk () from /usr/lib/x86_64-linux-gnu/libuv.so.1
#2  0x00007fffec72073f in zm_deactivate_uv (type=<optimized out>, module_number=<optimized out>) at /tmp/pear/temp/uv/php_uv.c:2700
#3  0x0000555555b7fc4c in zend_deactivate_modules () at /root/php-src/Zend/zend_API.c:2637
#4  0x0000555555b08062 in php_request_shutdown (dummy=<optimized out>) at /root/php-src/main/main.c:1878
#5  0x0000555555c35350 in do_cli (argc=5, argv=0x555556787090) at /root/php-src/sapi/cli/php_cli.c:1178
#6  0x00005555556e3463 in main (argc=5, argv=0x555556787090) at /root/php-src/sapi/cli/php_cli.c:1404
(gdb)
Charlotte Dunois
@CharlotteDunois
@WyriHaximus cc bwoebi/php-uv#79
Cees-Jan Kiewiet
@WyriHaximus
@CharlotteDunois :+1:
Luiz Brandao
@luiz-brandao-jr
Hey there, if I need to use a driver/extension that is not async, what are the strategies that I can use to go around that problem? Could I have a separate process/service whose sole responsibility is to run the blocking code but that could be accessed asynchronously?
PurHur
@PurHur
you could start it in a new process and then grab the io streams to read from them
then its all async
Charlotte Dunois
@CharlotteDunois
@PurHur That doesn't make a native PHP extension async.
@luiz-brandao-jr Yeah, you want to spawn a new PHP process, that uses a ReactPHP event loop (to still react event-based) but runs blocking code. Since the purpose is to only receive commands, run them and return the response, a blocked event loop isn't a problem here. You only need to keep an eye that everything is there serialized, thus if you need concurrency you need a pool of "workers".
Basil
@nadar
Hi everyone, i am trying to setup a socket server, only for local testing . When using new Server('0.0.0.0:8009', $loop); and trying to connect with my client (for example vuejs) ws://192.168.0.91:8009/ i always get failed: Error during WebSocket handshake: net::ERR_INVALID_HTTP_RESPONSE - maybe this has something to do with SSL?

i have also added the on listeneres, and can see the client trys to connect:

21.01.2020 13:04:50: new connection 192.168.0.91
21.01.2020 13:04:50: ended 192.168.0.91
21.01.2020 13:04:50: closed 192.168.0.91

so its able to reach the server, but the handshake fails.

Basil
@nadar
i think i found the solution: https://github.com/ratchetphp/Ratchet
Christian Lück
@clue
@nadar Yep, Ratchet is the way go to :+1:
Luiz Brandao
@luiz-brandao-jr
So I'm working on a project where I will have around 2k long lasting processes running (think of it this way, I'm creating a web interface for a desktop/cli app). I'm trying to find the best solution given the constraints. The code is stateful, thus the long lasting process. The process will run as long as the user is connected. A process takes a lot of memory and I will always have the risk of having memory leaks. I was thinking of maybe using Threads to reduce memory usage, but there doesn't seem to exist a good solution in PHP for that. What features of ReactPHP could I use for my case?
Cees-Jan Kiewiet
@WyriHaximus
@luiz-brandao-jr 2k long running processes sound rather excessive, what do they do? Because one per user is not a scaleable solution
Christian Lück
@clue
@luiz-brandao-jr Very much possible using ReactPHP's child-processes, but for this kind of load you will likely want to look into some XYZ scaling patterns to offload work to multiple servers and scale your system depending on system load
Some quick estimations suggest 2000 connections * 200 MB RAM per process = 400 GB of RAM to keep all processes running (many variables here, but it's always good to have some rough estimation)
Certainly doable, but you probably don't want to run this on a single host system
If you need help, let's chat: consulting@clue.engineering :-P
Charlotte Dunois
@CharlotteDunois
@luiz-brandao-jr Neither a one-process-per-user nor a one-thread-per-user is a scalable solution, regardless whether memory is shared or not. What you need is an asynchronous solution and fall back to worker processes for the necessary blocking part, that can't be converted to non-blocking. You probably want to look into different implementations or even languages to suit your needs.
Luiz Brandao
@luiz-brandao-jr
Thanks, I will reflect on that.