Coder Social home page Coder Social logo

协程websocketk客户端咨询 about mix HOT 5 CLOSED

mix-php avatar mix-php commented on May 18, 2024
协程websocketk客户端咨询

from mix.

Comments (5)

onanying avatar onanying commented on May 18, 2024

框架暂时没有封装 swoole 的协程客户端,客户端 swoole 官方提供的本来就高度封装,大家可以直接使用。

from mix.

onanying avatar onanying commented on May 18, 2024

后续版本可能我会增加

from mix.

excxapp avatar excxapp commented on May 18, 2024

好的,辛苦大佬。
另外,协程池这个,如何使用,我是要作为
消息队列(MQ)消费处理(发送邮件、短信)
这种用途,能给一个简单的发邮件的例子吗
比如消费rabbitmq或者redis的简单demo
刚接触这个框架,不是很明白使用。

from mix.

onanying avatar onanying commented on May 18, 2024

官网有这个demo的链接:Mix PHP V2 实例:协程池异步邮件发送守护程序 https://www.jianshu.com/p/ea635ad7fa9d

from mix.

onanying avatar onanying commented on May 18, 2024

https://www.kancloud.cn/onanying/mixphp2/1002219

go(function () {
    $cli = new \Swoole\Coroutine\http\Client("127.0.0.1", 9502);
    $ret = $cli->upgrade("/websocket");
    if ($ret) {
        $cli->push('{"method":"join.room","params":{"roomid":1010},"id":1}');
        while (true) {
            $data = $cli->recv();
            if ($data === false) {
                echo "disconnect" . PHP_EOL;
                break;
            }
            var_dump($data);
        }
    }
});

from mix.

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.