Giter Site home page Giter Site logo

swooleserverandclient's Introduction

swoole简单的客户端,服务端异步工厂任务

使用场景

在php-fpm模式下,php处理耗时比较长任务时,会发生堵塞,此时可以用异步方法,将该任务抛出,程序继续向下执行

在api接口场景下,可以使用我的另一个项目yaf_api,同样支持异步任务,压测性比php-fpm高

基本使用

这里只是简单了使用异步任务,目的让大家可以通俗的理解swoole task使用

//1.开启服务端
php app/Server.php

//2.客户端链接服务端,并发送异步任务
新打开另一个终端
php app/Client.php
task中通过$data['event'] 来判断处理哪个事件,如发送邮件,短信发送等

swooleserverandclient's People

Contributors

gnpok 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.