Giter Club home page Giter Club logo

ou.sop's Introduction

ou.sop

swoole面向服务编程案例

Swoole : PHP的异步、并行、高性能网络通信引擎,使用纯C语言编写,提供了PHP语言的异步多线程服务器,异步TCP/UDP网络客户端,异步MySQL,异步Redis,数据库连接池,AsyncTask,消息队列,毫秒定时器,异步文件读写,异步DNS查询。

####安装: git clone https://github.com/ouyangjunqiu/ou.sop cd ou.sop/ composer install

####启动: bin/start

####案例:

  1. 邮件服务

     $client = new swoole_client(SWOOLE_SOCK_TCP);
     
     if (!$client->connect('127.0.0.1', 9501, -1))
     {
     
         exit("connect failed. Error: {$client->errCode}\n");
     }
     
     $msg = array("exec"=>"mail","subject"=>"测试邮件","msg"=>"这是系统测试邮件发出,请勿理会。","address"=>array("oshine"=>"[email protected]"));
     $msg = json_encode($msg);
     $client->send($msg);
     
     $client->close();
    
  2. 数据分析服务

ou.sop's People

Contributors

ouyangjunqiu avatar

Watchers

James Cloos avatar  avatar

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.