Git Product home page Git Product logo

Comments (4)

Volmarg avatar Volmarg commented on August 17, 2024

Solved it.

  • Why was not working: no idea,
  • Solution: dispatching async process to send notification just with exec

from pawl.

JokubasR avatar JokubasR commented on August 17, 2024

I found a better solution after spending some time on this issue. All you need to do is pass Loop while initiating connection and run it afterwards.

Minimal example:

$loop = \React\EventLoop\Loop::get();
\Ratchet\Client\connect('ws://127.0.0.1', [], [], $loop)->then(
    function (\Ratchet\Client\WebSocket $conn) use ($msg) {
        $conn->send($msg);
        $conn->close();
    }
);
$loop->run();

this way messages to websocket will be sent on every RabbitMQ message consumed

from pawl.

sebastianstucke87 avatar sebastianstucke87 commented on August 17, 2024

Sorry, but isn't it kinda inefficient to re-connect on every message while consuming RabbitMQ? I'm currently struggling with the exact same thing. Works like a charm with this ws-client but not Pawl...

from pawl.

334660335 avatar 334660335 commented on August 17, 2024

@JokubasR, it works! But will memory overflow occur? have some suggestions?

from pawl.

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.