Code Monkey home page Code Monkey logo

Comments (7)

pistej avatar pistej commented on June 14, 2024

Best way is to require https://github.com/hyperf/coordinator lib into composer, otherwise i would take almost all classes... @Rastusik are u OK with that, or should (copy-paste) required parts ?!

from swoole-bundle.

Rastusik avatar Rastusik commented on June 14, 2024

@pistej thank yo ufor your contribution! could you post any information about the problem? Why do you think that hyperf/coordinator is the best way to solve it? Isn't that a bug in swoole?

from swoole-bundle.

pistej avatar pistej commented on June 14, 2024

@Rastusik I'm, not sure about bug in swoole, I found info about this in official swoole (and openswoole documentation):

Before the server Start event, the Server has finished the following:

Created the Manager process
Created the Worker-Sub processes
Listening on the TCP/UDP port that was specified, no connections are accepted until this event returns
Started the OpenSwoole Timer process
After the Start event executes, the reactor threads are ready to process server events and accept connections from clients.

also:

OnWorkerStart and onStart callbacks are executed in parallel in different processes, with no order of precedence.

Hyperf fw solves that: https://github.com/hyperf/hyperf/blob/master/src/http-server/src/Server.php#L86

Coordinator lib just has functions which I would take to implement/fix this flow.

from swoole-bundle.

pistej avatar pistej commented on June 14, 2024

@Rastusik your opinion? would like to fix it some how :) thx.

from swoole-bundle.

Rastusik avatar Rastusik commented on June 14, 2024

@pistej sorry I didn't have a lot of time lately. Feel free to start a proof of concept if you wish and we will see. I'm kind of skeptical with the yeld approach here https://github.com/hyperf/hyperf/blob/master/src/http-server/src/Server.php#L87 ... but looks like it's not a real yield, so I may be wrong :)

from swoole-bundle.

pistej avatar pistej commented on June 14, 2024

@Rastusik It's not yeld, just naming... created POC PR

from swoole-bundle.

Rastusik avatar Rastusik commented on June 14, 2024

@pistej released

from swoole-bundle.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.