Giter Club home page Giter Club logo

Comments (5)

kelunik avatar kelunik commented on May 21, 2024

You can't, unless one calls the other in a busy waiting manner. Why do you want two?

from event-loop.

sm2017 avatar sm2017 commented on May 21, 2024

The reason is #121

I want have event as main loop and select for pg_socket

from event-loop.

WyriHaximus avatar WyriHaximus commented on May 21, 2024

@sm2017 you can't without the loops blocking each other, have you tried any of the other event loops?

from event-loop.

mbonneau avatar mbonneau commented on May 21, 2024

@sm2017 - If you are just looking for an async way to use Postgres - take a look at https://github.com/voryx/PgAsync which is based on react and rxphp.

This library is a 100% native PHP implementation.

from event-loop.

clue avatar clue commented on May 21, 2024

The short version is: You can't.

The longer version is: You shouldn't. There are a number of work-arounds which basically resolve to polling one loop from the other one as @kelunik suggested or you may spawn/fork multiple processes and use some kind of IPC protocol etc.

The linked ticket #121 is a very specific issue with ext-event, so I would still suggest reporting this upstream and validating why this causes a SEGFAULT to begin with. As an alternative, I would suggest looking into using one of the alternative loop implementations as @WyriHaximus suggested. Also, @mbonneau made a very good point about using another database layer to avoid this issue in the first place.

I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍

from event-loop.

Related Issues (20)

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.